isOpen | boolean | — | Sets the open state of the menu. |
defaultOpen | boolean | — | Sets the default open state of the menu. |
onOpenChange | (
(isOpen: boolean
)) => void | — | Method that is called when the open state of the menu changes. |
items | Iterable<T> | — | Item objects in the collection. |
disabledKeys | Iterable<Key> | — | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. |
isDisabled | boolean | — | Whether the input is disabled. |
isRequired | boolean | — | Whether user input is required on the input before form submission. |
isInvalid | boolean | — | Whether the input value is invalid. |
validationBehavior | 'aria' | 'native' | 'aria' | Whether to use native HTML form validation to prevent form submission
when the value is missing or invalid, or mark the field as required
or invalid via ARIA. |
validate | (
(value: Key
)) => ValidationError
| true
| null
| undefined | — | A function that returns an error message if a given value is invalid.
Validation errors are displayed to the user when the form is submitted
if validationBehavior="native" . For realtime validation, use the isInvalid
prop instead. |
description | ReactNode | — | A description for the field. Provides a hint such as specific requirements for what to choose. |
errorMessage | ReactNode | (
(v: ValidationResult
)) => ReactNode | — | An error message for the field. |
label | ReactNode | — | The content to display as the label. |
placeholder | string | — | Temporary text that occupies the text input when it is empty. |
selectedKey | Key | null | — | The currently selected key in the collection (controlled). |
defaultSelectedKey | Key | — | The initial selected key in the collection (uncontrolled). |
onSelectionChange | (
(key: Key
)) => any | — | Handler that is called when the selection changes. |
autoFocus | boolean | — | Whether the element should receive focus on render. |
onFocus | (
(e: FocusEvent<Target>
)) => void | — | Handler that is called when the element receives focus. |
onBlur | (
(e: FocusEvent<Target>
)) => void | — | Handler that is called when the element loses focus. |
onFocusChange | (
(isFocused: boolean
)) => void | — | Handler that is called when the element's focus status changes. |
onKeyDown | (
(e: KeyboardEvent
)) => void | — | Handler that is called when a key is pressed. |
onKeyUp | (
(e: KeyboardEvent
)) => void | — | Handler that is called when a key is released. |
collection | Collection<Node<T>> | — | A pre-constructed collection to use instead of building one from items and children. |