Select
A styled native <select>: the browser owns the popup, keyboard, typeahead,
form participation and the platform picker on mobile. This layer styles the
closed control and adds label, placeholder, width modes and the invalid state.
Options are plain text by design — the native popup can’t render markup. For per-option icons, rich option content or a styled popup, use the Combobox (optionally with the search hidden): that is the custom, advanced select.
Select or Dropdown Menu?
Section titled “Select or Dropdown Menu?”They share the popup mechanics, but they are different components with different semantics:
- Select is a form control: it picks a value that persists, is
announced as selected, submits with the form natively (it is a real
<select name>, so the browser also runsrequiredvalidation), and supportslabel/required/error. - Dropdown Menu is a
menu of actions: its items run commands (
role="menu"/role="menuitem"), nothing stays selected and no form value exists.
Rule of thumb: if “what’s in the field right now?” makes sense, use Select; if the items are verbs (Rename, Delete, Share…), use Dropdown Menu.
Import
Section titled “Import”<script> import Select from "@invisible-ui/svelte/Select.svelte";</script><script setup> import { Select } from "@invisible-ui/vue";</script>import { Select } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-select></ds-select>| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Accessible name for the control. |
hideLabel | boolean | false | Visually hide the label (kept for assistive tech) — for compact toolbars. |
items * | SelectItem[] | — | Options ({ value, label?, disabled? }); label falls back to value. |
value | string | null | null | Selected value. |
placeholder | string | undefined | undefined | Trigger text when nothing is selected. |
disabled | boolean | false | Disable the control. |
width | "wrap" | "fill" | "fixed" | "wrap" | Width behaviour: wrap fits the longest option (plus the trigger padding), fill takes 100% of the container, fixed uses --ds-select-width (16rem by default). |
name | string | undefined | undefined | Form field name — the selected value is submitted under it (via a hidden input). |
required | boolean | false | Marks the control as required (announced to assistive tech). |
error | string | undefined | undefined | Error message; when non-empty the select becomes invalid and announces it. |
onValueChange | ((value: string) => void) | undefined | undefined | Called whenever the selected value changes. |
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Accessible name for the control. |
hideLabel | boolean | false | Visually hide the label (kept for assistive tech), for compact toolbars. |
items * | SelectItem[] | — | Options. Plain text only; see the note on rich options below. |
modelValue | string | null | undefined | v-model value; takes precedence over value when bound. |
value | string | null | null | Selected value. null shows the placeholder. |
placeholder | string | undefined | Shown while nothing is selected. Defaults to the catalog's "Select…". |
disabled | boolean | false | |
width | "wrap" | "fill" | "fixed" | "wrap" | Width behaviour: wrap fits the longest option (the native default), fill takes 100% of the container, fixed uses --ds-select-width. |
name | string | undefined | Form field name; this is a real <select>, so it submits natively. |
required | boolean | false | Marks the control as required (native validation + announced to AT). |
error | string | undefined | Error message; when non-empty the select becomes invalid and announces it. |
onValueChange | (value: string) => void | undefined | Called whenever the selected value changes. |
| Event | Payload |
|---|---|
update:modelValue | value: string | null |
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Accessible name for the control. |
hideLabel | boolean | false | Visually hide the label (kept for assistive tech) — for compact toolbars. |
items * | SelectItem[] | — | Options. Plain text only — see the note on rich options below. |
value | string | null | null | Selected value. null shows the placeholder. |
placeholder | string | — | Shown while nothing is selected. Defaults to the catalog's "Select…". |
disabled | boolean | false | |
width | "wrap" | "fill" | "fixed" | "wrap" | Width behaviour: wrap fits the longest option (the native default), fill takes 100% of the container, fixed uses --ds-select-width. |
name | string | — | Form field name — this is a real <select>, so it submits natively. |
required | boolean | false | Marks the control as required (native validation + announced to AT). |
error | string | — | Error message; when non-empty the select becomes invalid and announces it. |
onValueChange | (value: string) => void | — | Called whenever the selected value changes. |
| Attribute | Reactive | Description |
|---|---|---|
label * | yes | |
hide-label | yes | |
value | yes | |
placeholder | yes | |
disabled | yes | |
width | yes | wrap|fill|fixed |
name | yes | |
required | yes | |
error | yes | |
title | yes |
Reactive attributes re-render the element when they change after the first render.
Emits: bubbling change CustomEvent with detail.value.
Accessibility
Section titled “Accessibility”- A real
<select>: the browser provides the popup, keyboard, typeahead, screen-reader semantics,requiredvalidation and the mobile picker. - The visible label is a
<label for>;errormaps toaria-invalidplus an announced description.
Example
Section titled “Example”<Select label="Country" items={[ { value: "it", label: "Italy" }, { value: "fr", label: "France" }, ]} onValueChange={(v) => (country = v)}/>Themeable via --ds-select-*.