ListBox
A named single or multiple selection list with native validation and semantic feedback.
Preview
ReactComponent-based interfaces
VueProgressive interfaces
Svelte
Unavailable framework
Choose the tools for your project.
Use ListBox
ListBox is a named export of @flood-md/react. Connect the package once, then import what you use.
Design notes
- Use a scalar value/defaultValue in single mode and an array in multiple mode. onValueChange returns the matching shape. Stable, unique nonempty option IDs are submitted as repeated hidden native form fields when name is supplied. Uncontrolled reset restores the initial selection.
- The list owns one Tab stop and aria-activedescendant. Arrows/Home/End move through enabled options; single selection follows navigation. Space/Enter selects or toggles. Typing searches option-label prefixes. Disabled options cannot be selected; readOnly retains navigation and copying without changing the value.
- Provide a clear label or use hideLabel with the accessible label preserved. Use disabled on the composite to remove its Tab stop. The list is not virtualized and does not fetch options. Available in 0.2.5.
- required validates accepted selection; readonly bypasses validation and disabled excludes form values.
- description/message and status share the field feedback contract. validationMessage is a host-owned blocking constraint.
API reference
View TypeScript source