Skip to content
Nana UI

Dropdown

View .md Download

A trigger that reveals a panel of options — single or multi-select, optionally searchable. Compose it from nana-option children (use nana-menu-label for groups). Flips above the trigger when it would overflow.

Ada Lovelace Alan Turing Paula Hawkins
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/dropdown";

Add the searchable attribute to filter options as you type.

United States Canada Mexico

Set select="multiple" to allow multiple selections.

React Vue Svelte

Use nana-menu-label to group options.

Design Ada Lovelace Engineering Alan Turing
<nana-dropdown label="Assign to">
<nana-option value="ada">Ada Lovelace</nana-option>
<nana-option value="alan">Alan Turing</nana-option>
</nana-dropdown>

Properties

PropertyAttributeTypeDefaultDescription
disabledbooleanfalseDisable the dropdown
labelstring'Select'Trigger label / placeholder (default trigger only)
openbooleanfalseOpen state
searchablebooleanfalseShow a search field that filters the options
selectDropdownSelect'single'Single or multiple selection
valuestring''Selected value(s) — comma-separated for multiple

Events

EventDescription
nana-changeFired on selection (`detail.value` — string or string[])

Slots

SlotDescription
triggerCustom trigger element (falls back to a default button)
(default)`nana-option` / `nana-menu-label` children

CSS parts

PartDescription
::part(panel)The floating options panel

CSS custom properties

PropertyDescription
--nana-dropdown-max-heightPanel max height before scrolling
EventTypeDescription
nana-changeCustomEventFired on selection (detail.value — string or string[])
SlotDescription
triggerCustom trigger element (falls back to a default button)
(default)nana-option / nana-menu-label children
VariableDefaultDescription
--nana-dropdown-max-heightPanel max height before scrolling
PartDescription
panelThe floating options panel
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Dropdown interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook