Listbox

atoms

Keyboard-navigable listbox with single/multi-select, option groups, and custom rendering. Follows WAI-ARIA Listbox pattern (1.2). Used internally by Select and TimePicker.

ARIA Role: listbox

Demo

Demo for Listbox (atoms)

Keyboard-navigable listbox with single/multi-select, option groups, and custom rendering. Follows WAI-ARIA Listbox pattern (1.2). Used internally by Select and TimePicker.

Props

PropTypeRequiredDefaultDescription
optionsListboxOption[]YesArray of options with value, label, disabled, group, description
mode'single' | 'multiple'No'single'Single or multi-select mode
valuestring | string[]YesSelected value(s)
defaultValuestring | string[]NoInitial uncontrolled value
onChange(value: string | string[]) => voidYesCallback when selection changes
size'sm' | 'md' | 'lg'No'md'Size variant
variant'default' | 'bordered' | 'flush'No'default'Visual style variant
emptyMessagestringNo'No options'Message shown when options array is empty
disabledbooleanNofalseDisable the entire listbox
ariaLabelstringYesAccessible label for the listbox
ariaLabelledBystringNoID of element that labels this listbox
maxHeightnumberNoMax height in pixels before scrolling
groupsArray<{ id: string; label: string }>NoOption group headers
autoFocusFirstOptionbooleanNofalseAuto-focus first option on mount
renderOption(option, state) => ReactNodeNoCustom option renderer
localestringNoLocale for text formatting
classNamestringNoAdditional CSS classes
idstringNoDOM id

Usage

Import

import { Listbox } from '@epasslive/design-system'

Basic

<Listbox />

With Variants

<Listbox variant="primary" size="md" />