components/listbox
@fungi.computer/caps / components/listbox
components/listbox
Section titled “components/listbox”Type Aliases
Section titled “Type Aliases”ListboxItemState
Section titled “ListboxItemState”ListboxItemState =
object
Intrinsic focus and selection state supplied when rendering a Listbox item.
Properties
Section titled “Properties”active
Section titled “active”active:
boolean
disabled
Section titled “disabled”disabled:
boolean
selected
Section titled “selected”selected:
boolean
ListboxProps
Section titled “ListboxProps”ListboxProps<
T,Multiple> > =object&Omit<HTMLAttributes<HTMLDivElement>>,"defaultValue"|"onChange"|"onSelect"|"value">>
Props accepted by Listbox.
Type Declaration
Section titled “Type Declaration”defaultValue?
Section titled “defaultValue?”
optionaldefaultValue?:ListboxValue<Multiple>>
emptyMessage?
Section titled “emptyMessage?”
optionalemptyMessage?:ReactNode
getKey
Section titled “getKey”getKey: (
item) =>string
Returns the stable key used for focus and selection.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”string
getLabel
Section titled “getLabel”getLabel: (
item) =>string
Returns the accessible label used for an item.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”string
isDisabled?
Section titled “isDisabled?”
optionalisDisabled?: (item) =>boolean
Determines whether an item can receive focus or selection.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”boolean
items: readonly
T[]
multiple?
Section titled “multiple?”
optionalmultiple?:Multiple
onValueChange?
Section titled “onValueChange?”
optionalonValueChange?: (value,item) =>void
Receives the next value and selected item after local interaction.
Parameters
Section titled “Parameters”ListboxValue<Multiple>
Multiple extends true ? T[] : null | T
Returns
Section titled “Returns”void
renderItem?
Section titled “renderItem?”
optionalrenderItem?: (item,active,state) =>ReactNode
Renders an item with its intrinsic focus and selection state.
Parameters
Section titled “Parameters”T
active
Section titled “active”boolean
Returns
Section titled “Returns”ReactNode
value?
Section titled “value?”
optionalvalue?:ListboxValue<Multiple>>
Type Parameters
Section titled “Type Parameters”T
Multiple
Section titled “Multiple”Multiple extends boolean = false
ListboxValue
Section titled “ListboxValue”ListboxValue<
Multiple> > =Multipleextendstrue?string[] :null|string
Supported ListboxValue values.
Type Parameters
Section titled “Type Parameters”Multiple
Section titled “Multiple”Multiple extends boolean = false
Variables
Section titled “Variables”Listbox
Section titled “Listbox”
constListbox: <T,Multiple>>(props) =>ReactElement
A selection primitive with caller-owned values and intrinsic keyboard navigation.
Type Parameters
Section titled “Type Parameters”T
Multiple
Section titled “Multiple”Multiple extends boolean = false
Parameters
Section titled “Parameters”object & object & Omit<HTMLAttributes<HTMLDivElement>, "value" |
"defaultValue" | "onChange" | "onSelect">
Returns
Section titled “Returns”ReactElement