Launchable Motion

Components / UI

Dropdown select

Use it for a choice being made in UI: a rounded trigger that fills the host, whose background slides down onto the chosen item when the list opens and saturates to the highlight colour with a check mark, while the trigger label greys and the other items sit out of focus below.

Install

With this registry set in hyperframes.json (see the docs):

npx hyperframes add dropdown-select

Use it in a composition

It fills whatever box you give it, so set the host element's size and position. Set values withdata-variable-values.

<div data-composition-id="dropdown-select" data-composition-src="compositions/dropdown-select.html"
     data-start="0" data-duration="3" data-track-index="1"
     style="position:absolute;left:0;top:0;width:1920px;height:1080px"></div>

Variables

VariableTypeDefaultWhat it changes
labelstringSelect brandText before a choice.
itemsstringLaunchable|New brandPipe separated options in order.
chosennumber0Zero based index of the option picked.
openAtnumber0.4Seconds until the list opens.
closeAtnumber2.1Seconds until it closes. Negative keeps it open.
highlightcolor#ff7ad9Colour the selection saturates to.
idlecolor#f0edf0Trigger background before selection.
zoomnumber1.1Scale the group grows to while open.
inkcolor#1a1418Text colour.
fontfont"Instrument Serif",Georgia,serifDisplay face.
groundcolortransparentBackground; transparent to overlay.