Select
A <nana-select> element.
Preview
Section titled “Preview”<nana-select label="Country" style="min-width:16rem">
<nana-option value="ke">Kenya</nana-option>
<nana-option value="ug">Uganda</nana-option>
</nana-select> Installation
Section titled “Installation”npm install @nana-tec/ui-componentsImport
Section titled “Import”import "@nana-tec/ui-components/select";Basic usage
Section titled “Basic usage”<nana-select label="Country" style="min-width:16rem"> <nana-option value="ke">Kenya</nana-option> <nana-option value="ug">Uganda</nana-option></nana-select>Searchable
Section titled “Searchable”Add searchable to filter options; clearable adds a reset button.
<nana-select label="Country" placeholder="Search…" searchable clearable style="min-width:16rem">
<nana-option value="us">United States</nana-option>
<nana-option value="ca">Canada</nana-option>
<nana-option value="mx">Mexico</nana-option>
</nana-select> Multi-select
Section titled “Multi-select”Set multiple — selected values render as removable chips.
<nana-select label="Countries" placeholder="Select…" multiple clearable style="min-width:16rem">
<nana-option value="us">United States</nana-option>
<nana-option value="ca">Canada</nana-option>
<nana-option value="mx">Mexico</nana-option>
</nana-select> | Property | Type | Default | Description |
|---|---|---|---|
label | string | '' | — |
value | string | '' | — |
name | string | '' | — |
placeholder | string | '' | — |
size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | — |
open | boolean | false | — |
disabled | boolean | false | — |
required | boolean | false | — |
clearable | boolean | false | — |
searchable | boolean | false | — |
multiple | boolean | false | — |
invalid | boolean | false | — |
helperText | string | '' | — |
errorMessage | string | '' | — |
inputId | — | nana-select-${Math.random().toString(36).slice(2, 7)} | — |
CSS Parts
Section titled “CSS Parts”| Part | Description |
|---|---|
trigger | The trigger element |
panel | The floating listbox panel |
chip | A selected-value chip (multi-select only) |
search | The search input |
Accessibility
Section titled “Accessibility”- Keyboard accessible
- Screen-reader labels
- Focus-visible states
- ARIA roles and states
- WCAG 2.2 AA contrast
Related components
Section titled “Related components”Storybook
Section titled “Storybook” Explore Select interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook