The default way to generate a "unique" id for each option within the listbox by concatenating the current index with a base id.
Note: The index will be incremented by 1 so the ids start from 1 instead of
0. This is so that it matches how paginated results work with aria-posinset
aria-setsize
.The base id of the listbox.
The current index of the option
a "unique" id for the option
A function that will get the label for an option. The default behavior is to
check if the option is an object. If it is, it'll use the labelKey
property
and fallback to the children
property. If it is anything else, the option
itself will be returned.
This is used in both the select's button element to show the current value as well as rendering each option within the listbox component.
The option that should be converted into a renderable label element.
The object key to use to extract the label from an option object.
a renderable label to display.
The default implementation of the getItemValue search option that will attempt to "stringify" any unknown item as a string.
The current item to transform
The key to use that should hold the value if the item is an object
the item as a string
A key to use that extracts the display label for an option from the options
list. This will only be used if the option is an object and is passed to
the getOptionLabel
prop.
An optional name to provide for the listbox that will be provided with the
onChange
callback.
The list of options to display within the listbox.
Boolean if the portal should be used.
The listbox is a controlled component, so you will need to provide the
current value and an onChange
handler. The value
must be a string and
should be one of the option's values when something has been selected. If
you want to have an "empty" select box to require the user to manually
select something to be considered valid, you can set this to the empty
string and it'll be considered "unvalued".
A key to use that extracts the value for the option from the options list.
This will only be used if the option is an object and will be passed to the
getOptionValue
prop.
A function to call for each option to check if it is currently disabled.
This is really just a convenience prop so that you don't need to modify the
options
yourself.
Generated using TypeDoc
Boolean if using the keyboard should not immediately trigger the
onChange
callback. When this is enabled, theonChange
callback will only be called if the user clicks an item or presses the enter or space key.