Reference
Nodes
Components
Dropdown

Dropdown Component

Dropdowns are a common form control that allows the user to select from a list of options.

Users can click on the dropdown to display a list of options, or start typing to fuzzy-find to jump directly to their choice within a larger lists of options.

Dropdowns emit the change event when their selection changes. When disabled, the user will not be able to change the value of a dropdown, and no change events will be emitted.

Properties

Visible

PropisVisible
Typeboolean
Defaulttrue

Whether or not this node is visible.

Enabled

PropisEnabled
Typeboolean
Defaulttrue

Whether or not this node is enabled.

Tooltip

Proptooltip
Typestring
Defaultundefined

The tooltip text to display when hovered or focused over this node.

Top

Proptop
Typenumber
Default1

The position of the node from the top side of the grid (grid-row-start).

Left

Propleft
Typenumber
Default1

The position of the node from the left side of the grid (grid-column-start).

Width

Propwidth
Typestring
Default232px

The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4 will become grid-column-end: span 4). When this node is in a stack layout, the width can be specified using CSS units (e.g. 100px or 100%), or be left unitless to be treated as flex-grow for the node.

Min Width

PropminWidth
Typestring
Defaultundefined

The minimum width of the node. When this node is in a grid layout, this property is ignored.

Max Width

PropmaxWidth
Typestring
Defaultundefined

The maximum width of the node. When this node is in a grid layout, this property is ignored.

Height

Propheight
Typestring
Default64px

The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4 will become grid-row-end: span 4). When this node is in a stack layout, the height can be specified using CSS units (e.g. 100px or 100%), or be left unitless to be treated as flex-grow for the node.

Min Height

PropminHeight
Typestring
Defaultundefined

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Max Height

PropmaxHeight
Typestring
Defaultundefined

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Overflow

Propoverflow
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.

Overflow X

PropoverflowX
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal axis for content that is larger than its container.

Overflow Y

PropoverflowY
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the vertical axis for content that is larger than its container.

Custom Styles

Propstyles
Typestring
Default::component { }

Custom CSS styles to be applied to the node. Use element.styles to refer to the current node.

Object Fit

PropobjectFit
TypeObjectFit ('none' | 'contain' | 'cover' | 'fill' | 'scale-down')
Defaultcover

The strategy used to set how the content of a replaced element should be resized to fit its container.

Field Name

PropformFieldName
Typestring
Defaultundefined

Defines the key for this input in the body of the submitted form.

Label

Proplabel
Typestring
DefaultSelect one

The label to be displayed alongside the dropdown.

Values

Propvalues
TypeArray<unknown>
Default{{[1, 2, 3]}}

The array of values that the user is able to choose from. Values can be any TypeScript value, including objects. Often, it is useful to display a human-readable string to the user of a dropdown using the displayValues property, and instead use a machine-readable value in this property, such as an ID or row object.

Display Values

PropdisplayValues
TypeArray<string>
Defaultundefined

The array of human-readable displayed values that the user is able to choose from. This array should have the same length as values, but must contain only strings.

Selected Value

Propvalue
Typeunknown
Defaultundefined

The selected value of the dropdown. This can be one of the options from values, or undefined when no value is selected.

Placeholder

Propplaceholder
Typestring
Defaultundefined

The placeholder value to display when no option has been selected.

Enable

PropenableFilter
Typeboolean
Defaultfalse

Whether or not to enable filtering of (options)[#display-values] as user types.

Fuzzy Matching

PropfuzzyMatching
Typeboolean
Defaulttrue

Whether or not to enable fuzzy-find matching of dropdown items when using the keyboard.

Case-sensitive Matching

PropcaseSensitiveMatching
Typeboolean
Defaultfalse

Whether or not to enable case-sensitive matching of dropdown items when using the keyboard.

Required

PropisRequired
Typeboolean
Defaultfalse

Whether or not this dropdown is required. This is a visual flag that updates the corresponding accessibility properties. It is up to the app developer to enforce the requirement.

Allow Clearing

PropallowClearing
Typeboolean
Defaulttrue

Whether or not to allow clearing of the dropdown after a selection has been made. This will reset the dropdown's (value)[#value].

Label Style

ProplabelStyle
TypeDropdownLabelStyle ('left' | 'top' | 'hidden' | 'right')
Defaulttop

The display style of the label next to the dropdown.

Label Width

ProplabelWidth
Typestring
Default35%

The width of the label.

Font Size

PropfontSize
TypeCheckboxSize ('xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl')
Defaultmd

The size of the font. Size is a measurement value like "md" and can be configured in the theme.

Background Color

PropbackgroundColor
Typestring
Defaultinput.background

The background color of the dropdown.

Label Color

ProplabelColor
Typestring
Defaulttext.primary

The color of the label text.

Input Color

PropinputColor
Typestring
Defaulttext.primary

The color of the input text.

Placeholder Color

PropplaceholderColor
Typestring
Defaultinput.placeholder

The color of the placeholder text.

Event Handlers

On Hover

HandlerdropdownNode.onHover

Called when the user hovers on the node. Use this event to trigger downstream actions when this node is hovered.

On Leave

HandlerdropdownNode.onLeave

Called when the user is not hovering over the node. Use this event to trigger downstream actions when this node is no longer hovered.

On Focus

HandlerdropdownNode.onFocus

Called when the user focuses the node. Use this event to trigger downstream actions when this node is focused.

On Blur

HandlerdropdownNode.onBlur

Called when the user blurs the node. Use this event to trigger downstream actions when this node is blurred.

On Change

HandlerdropdownNode.onChange

Called when the selected dropdown option changes.