selectionMode | SelectionMode | 'single' | Whether single or multiple selection is enabled. |
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. |
value | ValueType<SelectionMode> | — | The current value (controlled). |
defaultValue | ValueType<SelectionMode> | — | The default value (uncontrolled). |
onChange | ( (value: T )) => void | — | Handler that is called when the value changes. |
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: ValidationType<SelectionMode> )) => 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. |
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. |