The current active item id. The active item is the element within the
composite widget that has either DOM or virtual focus (in case
virtualFocus
is enabled).
null represents the composite element (the one with a composite
role). Users will be able to
navigate out of it using arrow keys.
If activeId is initially set to null, the
compositeElementInFocusOrder
prop will also default to true, which means the composite element
itself will have focus and users will be able to navigate to it using
arrow keys.
The composite item id that should be active by default when the composite
widget is rendered. If null, the composite element itself will have focus
and users will be able to navigate to it using arrow keys. If undefined,
the first enabled item will be focused.
The initial value of the
selectedValue
state. This can be a string or an array of strings. If it's an array, the
combobox is considered
multi-selectable.
The default value is "" for a plain combobox. When a
ComboboxSelect is
rendered, the first enabled item with a defined value is selected instead.
Pass "" explicitly to prevent this automatic selection.
A reference to another disclosure store that controls another disclosure
component to keep them in sync. Element states like contentElement and
disclosureElement won't be synced. For that, use the
store prop
instead.
The ID of the composite store is used to reference elements within the
composite widget before hydration. If not provided, a random ID will be
generated.
Lists all items along with their metadata. This state is automatically
updated when an item is registered or unregistered using the
registerItem
function.
Defines the orientation of the composite widget. If the composite has a
single row or column (one-dimensional), the orientation value determines
which arrow keys can be used to move focus:
both: all arrow keys work.
horizontal: only left and right arrow keys work.
vertical: only up and down arrow keys work.
It doesn't have any effect on two-dimensional composites.
Whether to reset the value when the combobox popover closes. This prop is
automatically set to true by default if the combobox supports multiple
selections. In other words, if the
selectedValue
or
defaultSelectedValue
props are arrays. However, when the combobox is connected to a
tag store, the
default is false so the input value is kept when the popover closes.
The value(s) of the currently selected item(s). This can be a string or an
array of strings. If it's an array, the combobox is considered
multi-selectable.
Whether the combobox
selectedValue
should be set when the active item changes by moving while
ComboboxSelect is open.
The selected value is always updated when moving while the select is
closed.
A callback that's invoked when the
selectedValue
state changes, typically when the user selects an item. This can be used to
implement behavior like onSelect or onItemSelect.
If enabled, the composite element will act as an
aria-activedescendant
container instead of roving
tabindex.
DOM focus will remain on the composite element while its items receive
virtual focus.
In both scenarios, the item in focus will carry the
data-active-item
attribute.
Deprecated: Manually setting the animated prop is no longer necessary.
This will be removed in a future release.
Determines whether the content should animate when it is shown or hidden.
If true, the animating state will be true when the content is shown
or hidden and it will wait for a CSS animation/transition to end before
becoming false.
If it's set to a number, the animating state will be true when the
content is shown or hidden and it will wait for the number of
milliseconds to pass before becoming false.
Whether to reset the value when an item is selected. This prop is
automatically set to true by default if the combobox supports multiple
selections. In other words, if the
selectedValue
or
defaultSelectedValue
props are arrays.
A reference to another disclosure store that controls another disclosure
component to keep them in sync. Element states like contentElement and
disclosureElement won't be synced. For that, use the
store prop
instead.
A function that can be used to recompute the popover position. This is
useful when the popover anchor changes in a way that affects the popover
position.
Deprecated: Use setState("animating", false) instead.
Sets the animating state to false, which will automatically set the
mounted state to false if it was true. This means that the content
element can be safely unmounted.