Listbox
A list of options that stays in view, for picking one or many with the pointer or the keys.
Examples
Default
Press an option to pick it. Arrows, Home, End and typing a name move through the list; Space or Enter picks. In a Field, the list takes its label, description, error and disabled state.
Labels in this view
3 of 6 labels. Docs is managed by the docs team.
Multiple
With multiple, a press or Space adds an option or takes it away. Shift with a press or Space picks the options in between, Shift with an arrow carries the pick along, and Ctrl+A or ⌘A picks them all.
Time zone
Due dates and the weekly digest follow it.
Groups
Options under a heading go in a ListboxGroup. Give the list a max-h- and it scrolls, keeping the option with focus in view.
Reviewers
Each pull request in Checkout asks them for a review.
Empty
ListboxEmpty shows while the list has no options, as when a search beside it finds none.
Installation
npx shadcn@latest add https://kinoui.com/r/listbox.json- Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/field-control.tsxlib/resize.tslib/run-progress.tslib/highlight.tscomponents/kino/separator.tsxlib/popup.tslib/menu.tsxlib/pick.tscomponents/kino/listbox.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Listbox
ListboxItem
Data attributes
Accessibility
- It follows the WAI-ARIA listbox pattern (opens in a new tab): the list is a
listbox, each row anoptionwitharia-selected, and a group agroupnamed by its heading. Tab lands on one option: the picked one, else the first. - A
<label>can’t name a listbox on its own, so in aFieldthe list takesaria-labelledbyfrom itsFieldLabel, and a press on the label moves focus into it. Its description and error become itsaria-describedby. Outside a field, name it witharia-labelledbyoraria-label. - While the list has no options,
ListboxEmpty’s text sits in astatusregion that was there from the start, so it is announced, and it describes the list for anyone who reaches it. - Up and Down move one option and stop at the ends. Home and End go to the first and last, and typing a name moves to the next option that starts with it. Space or Enter picks.
- With
multiple, the list isaria-multiselectable: Space adds or takes an option away, Shift+Space picks from the last option picked to this one, Shift with Up or Down carries the pick along, Ctrl+Shift+Home or End picks to that end, and Ctrl+A or ⌘A picks every option. - A disabled option is
aria-disabledand still takes focus, so it can be read. An invalid list takesaria-invalid, and keeps a dashed outline under forced colours. - Picked rows take the system’s highlight colours under forced colours, and the focus ring keeps an outline there.
- When the system asks for less motion, the highlight only fades and the tick appears without growing.