# Select primitives (/components/primitives/select)



Use these primitives when [`SelectField`](/components/forms/select-field) does not fit your layout.
They expose the root, trigger, value, indicator, popover, listbox, and option parts that
`SelectField` composes. Start with `SelectField` when it fits.

apps/docs/src/examples/select-primitive/basic.tsx

```tsx
import { Field } from '@luke-ui/react/primitives/field';
import {
	SelectIndicator,
	SelectItem,
	SelectListBox,
	SelectPopover,
	SelectRoot,
	SelectTrigger,
	SelectValue,
} from '@luke-ui/react/primitives/select';
import { Stack } from '@luke-ui/react/stack';

export default () => {
	return (
		<Stack gap="sp16" maxInlineSize="20rem">
			<SelectRoot name="country" placeholder="Choose a country">
				<Field description="Choose where you are based." label="Country">
					<SelectTrigger>
						<SelectValue />
						<SelectIndicator />
					</SelectTrigger>
					<SelectPopover>
						<SelectListBox>
							<SelectItem id="au">Australia</SelectItem>
							<SelectItem id="ca">Canada</SelectItem>
							<SelectItem id="nz">New Zealand</SelectItem>
						</SelectListBox>
					</SelectPopover>
				</Field>
			</SelectRoot>
		</Stack>
	);
};
```

## Anatomy [#anatomy]

`SelectRoot` is the semantic root. It connects the trigger to the label, description, and error
inside it, and normally owns the selection, open state, validation, form state, and size.
`SelectTrigger` is the button that opens the popover, and it draws the control chrome. It holds a
`SelectValue`, which shows the selected option, and a `SelectIndicator`. `SelectPopover` holds a
`SelectListBox`, which holds the `SelectItem` options.

Put the `SelectValue` before the `SelectIndicator`.

## Root props [#root-props]

Put `placeholder` and the selection, open state, validation, form, and size props on `SelectRoot`.
`value` and `defaultValue` take a key, or `null` for no selection, and `onChange` receives the same
type. A select has no read-only state.

`id`, `className`, and `ref` on `SelectRoot` target the root element. `triggerId` targets the
trigger, and `ref` on `SelectTrigger` reaches it.

## Options [#options]

Use `SelectItem` for options. `SelectListBox` accepts static children or `items` with a render
function.

## Indicator [#indicator]

`SelectIndicator` shows a chevron by default and sets `data-open` while the popover is open. Pass
`children` to replace the chevron.

apps/docs/src/examples/select-primitive/indicator.tsx

```tsx
import { Icon } from '@luke-ui/react/icon';
import {
	SelectIndicator,
	SelectItem,
	SelectListBox,
	SelectPopover,
	SelectRoot,
	SelectTrigger,
	SelectValue,
} from '@luke-ui/react/primitives/select';
import { Stack } from '@luke-ui/react/stack';

export default () => {
	return (
		<Stack gap="sp16" maxInlineSize="20rem">
			<SelectRoot aria-label="Sort order" defaultValue="newest">
				<SelectTrigger>
					<SelectValue />
					<SelectIndicator>
						<Icon name="expand" />
					</SelectIndicator>
				</SelectTrigger>
				<SelectPopover>
					<SelectListBox>
						<SelectItem id="newest">Newest first</SelectItem>
						<SelectItem id="oldest">Oldest first</SelectItem>
					</SelectListBox>
				</SelectPopover>
			</SelectRoot>
		</Stack>
	);
};
```

## Size [#size]

Set `size` on `SelectRoot`, and the trigger, indicator, and items follow. `medium` is the default.
Use `small` in compact layouts.

## Pending [#pending]

Pass `isPending` to `SelectTrigger` while a change is saving. The trigger keeps focus but can't be
pressed or opened, and can't change the value from the trigger, until pending ends.

## Validation [#validation]

Set `isInvalid` or a validation prop on `SelectRoot`. The trigger takes a danger border, and
`FieldError` inside `Field` shows the message and the error icon. See
[Validation](/docs/validation).

## Labels [#labels]

The label takes textual, non-interactive content only. Place a link or button outside it. To name
the select without a visible label, pass `aria-labelledby` or `aria-label` to `SelectRoot`.

## API [#api]

### SelectRootProps [#selectrootprops]

### SelectRootProps

Props for `SelectRoot`.

`SelectRootProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop                     | Type                         | Description                                                                                                                                                                                                      |
| ------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `aria-label?`            | `string`                     | Defines a string value that labels the current element.                                                                                                                                                          |
| `aria-labelledby?`       | `string`                     | Identifies the element (or elements) that labels the current element.                                                                                                                                            |
| `aria-describedby?`      | `string`                     | Identifies the element (or elements) that describes the object.                                                                                                                                                  |
| `aria-details?`          | `string`                     | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                               |
| `disabledKeys?`          | `object`                     | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.                                                                                                          |
| `onKeyDown?`             | `function`                   | Handler that is called when a key is pressed.                                                                                                                                                                    |
| `onKeyUp?`               | `function`                   | Handler that is called when a key is released.                                                                                                                                                                   |
| `onFocus?`               | `function`                   | Handler that is called when the element receives focus.                                                                                                                                                          |
| `onBlur?`                | `function`                   | Handler that is called when the element loses focus.                                                                                                                                                             |
| `onFocusChange?`         | `function`                   | Handler that is called when the element's focus status changes.                                                                                                                                                  |
| `slot?`                  | `union`                      | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
| `isOpen?`                | `union`                      | Sets the open state of the menu.                                                                                                                                                                                 |
| `defaultOpen?`           | `union`                      | Sets the default open state of the menu.                                                                                                                                                                         |
| `allowsEmptyCollection?` | `union`                      | Whether the select should be allowed to be open when the collection is empty.                                                                                                                                    |
| `autoComplete?`          | `string`                     | Describes the type of autocomplete the browser may offer for the hidden form control.                                                                                                                            |
| `autoFocus?`             | `union`                      | Whether the select should receive focus on render.                                                                                                                                                               |
| `form?`                  | `string`                     | The `<form>` element to associate the select with, by id.                                                                                                                                                        |
| `isDisabled?`            | `union`                      | Whether the select is disabled.                                                                                                                                                                                  |
| `isInvalid?`             | `union`                      | Marks the select invalid, for example after failed validation.                                                                                                                                                   |
| `isRequired?`            | `union`                      | Whether a selection is required before the form can submit.                                                                                                                                                      |
| `name?`                  | `string`                     | The name of the select, used when submitting an HTML form.                                                                                                                                                       |
| `validate?`              | `function`                   | Custom validation function run against the selected key. Return a message, or `true`/`null` when valid.                                                                                                          |
| `validationBehavior?`    | `union`                      | When native HTML form validation runs. Default: `'native'`                                                                                                                                                       |
| `children?`              | `ChildrenOrFunction<object>` | The select's parts: a `SelectTrigger` and a `SelectPopover`, plus any `Field` anatomy.                                                                                                                           |
| `defaultValue?`          | `union`                      | The initially selected key (uncontrolled).                                                                                                                                                                       |
| `id?`                    | `string`                     | Element id for the root element. Use `triggerId` for the trigger button.                                                                                                                                         |
| `onChange?`              | `function`                   | Called with the new key when the selection changes.                                                                                                                                                              |
| `onOpenChange?`          | `function`                   | Called when the open state changes.                                                                                                                                                                              |
| `placeholder?`           | `string`                     | Text shown in the `SelectValue` while nothing is selected.                                                                                                                                                       |
| `ref?`                   | `union`                      | Forwarded to the root element.                                                                                                                                                                                   |
| `size?`                  | `union`                      | Sets the size of the trigger, indicator, and items. Default: `'medium'`                                                                                                                                          |
| `triggerId?`             | `string`                     | Element id for the trigger button. The root generates one when omitted.                                                                                                                                          |
| `value?`                 | `union`                      | The selected key (controlled). Pass `null` for no selection.                                                                                                                                                     |


### SelectTriggerProps [#selecttriggerprops]

### SelectTriggerProps

Props for `SelectTrigger`.

`SelectTriggerProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop                | Type                         | Description                                                                                                                                                                                                      |
| ------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `aria-label?`       | `string`                     | Defines a string value that labels the current element.                                                                                                                                                          |
| `aria-labelledby?`  | `string`                     | Identifies the element (or elements) that labels the current element.                                                                                                                                            |
| `aria-describedby?` | `string`                     | Identifies the element (or elements) that describes the object.                                                                                                                                                  |
| `aria-details?`     | `string`                     | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                               |
| `onKeyDown?`        | `function`                   | Handler that is called when a key is pressed.                                                                                                                                                                    |
| `onKeyUp?`          | `function`                   | Handler that is called when a key is released.                                                                                                                                                                   |
| `onFocus?`          | `function`                   | Handler that is called when the element receives focus.                                                                                                                                                          |
| `onBlur?`           | `function`                   | Handler that is called when the element loses focus.                                                                                                                                                             |
| `onFocusChange?`    | `function`                   | Handler that is called when the element's focus status changes.                                                                                                                                                  |
| `onHoverStart?`     | `function`                   | Handler that is called when a hover interaction starts.                                                                                                                                                          |
| `onHoverEnd?`       | `function`                   | Handler that is called when a hover interaction ends.                                                                                                                                                            |
| `onHoverChange?`    | `function`                   | Handler that is called when the hover state changes.                                                                                                                                                             |
| `onPress?`          | `function`                   | Handler that is called when the press is released over the target.                                                                                                                                               |
| `onPressStart?`     | `function`                   | Handler that is called when a press interaction starts.                                                                                                                                                          |
| `onPressEnd?`       | `function`                   | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                              |
| `onPressChange?`    | `function`                   | Handler that is called when the press state changes.                                                                                                                                                             |
| `onPressUp?`        | `function`                   | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                          |
| `autoFocus?`        | `union`                      | Whether the element should receive focus on render.                                                                                                                                                              |
| `slot?`             | `union`                      | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
| `children`          | `ChildrenOrFunction<object>` | The `SelectValue` and `SelectIndicator`.                                                                                                                                                                         |
| `className?`        | `union`                      | Class name for the trigger button.                                                                                                                                                                               |
| `isPending?`        | `union`                      | Whether the trigger is pending. It keeps focus but can't be pressed or opened, and can't change the value from the trigger, until pending ends.                                                                  |
| `ref?`              | `union`                      | Forwarded to the trigger `<button>` element.                                                                                                                                                                     |


### SelectValueProps [#selectvalueprops]

### SelectValueProps

Props for `SelectValue`.

`SelectValueProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop        | Type                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `children?` | `ChildrenOrFunction<object>`        | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `render?`   | `DOMRenderFunction<"span", object>` | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `ref?`      | `union`                             | Forwarded to the value element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |


### SelectIndicatorProps [#selectindicatorprops]

### SelectIndicatorProps

Props for `SelectIndicator`.

`SelectIndicatorProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop        | Type        | Description                                                                        |
| ----------- | ----------- | ---------------------------------------------------------------------------------- |
| `children?` | `ReactNode` | Replaces the default chevron. The part keeps its layout and `data-open` attribute. |


### SelectPopoverProps [#selectpopoverprops]

### SelectPopoverProps

Props for `SelectPopover`.

`SelectPopoverProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop                            | Type                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `aria-label?`                   | `string`                           | Defines a string value that labels the current element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `aria-labelledby?`              | `string`                           | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `aria-describedby?`             | `string`                           | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `aria-details?`                 | `string`                           | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `children?`                     | `ChildrenOrFunction<object>`       | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `slot?`                         | `union`                            | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.                                                                                                                                                                                                                                                                                                             |
| `render?`                       | `DOMRenderFunction<"div", object>` | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `isOpen?`                       | `union`                            | Whether the overlay is open by default (controlled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `defaultOpen?`                  | `union`                            | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `onOpenChange?`                 | `function`                         | Handler that is called when the overlay's open state changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `placement?`                    | `union`                            | The placement of the element with respect to its anchor element. Default: `'bottom'`                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `containerPadding?`             | `number`                           | The placement padding that should be applied between the element and its surrounding container. Default: `12`                                                                                                                                                                                                                                                                                                                                                                                                                |
| `crossOffset?`                  | `number`                           | The additional offset applied along the cross axis between the element and its anchor element. Default: `0`                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `shouldFlip?`                   | `union`                            | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely. Default: `true`                                                                                                                                                                                                                                                                                                                                                           |
| `boundaryElement?`              | `object`                           | Element that that serves as the positioning boundary. Default: `document.body`                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `scrollRef?`                    | `object`                           | A ref for the scrollable region within the overlay. Default: `overlayRef`                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `shouldUpdatePosition?`         | `union`                            | Whether the overlay should update its position automatically. Default: `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `maxHeight?`                    | `number`                           | The maxHeight specified for the overlay element. By default, it will take all space up to the current viewport height.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `arrowBoundaryOffset?`          | `number`                           | The minimum distance the arrow's edge should be from the edge of the overlay element. Default: `0`                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `getTargetRect?`                | `function`                         | Overrides the target element's bounding rectangle. Useful for positioning relative to a specific point such as the mouse cursor (e.g. context menus) or text selection. Default: `target.getBoundingClientRect()`                                                                                                                                                                                                                                                                                                            |
| `onFocusWithin?`                | `function`                         | Handler that is called when the target element or a descendant receives focus.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `onBlurWithin?`                 | `function`                         | Handler that is called when the target element and all descendants lose focus.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `onFocusWithinChange?`          | `function`                         | Handler that is called when the the focus within state changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `arrowRef?`                     | `object`                           | A ref for the popover arrow element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `isNonModal?`                   | `union`                            | Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. Most popovers should not use this option as it may negatively impact the screen reader experience. Only use with components such as combobox, which are designed to handle this situation carefully.                                                                                                                                                                                                   |
| `isKeyboardDismissDisabled?`    | `union`                            | Whether pressing the escape key to close the popover should be disabled. Most popovers should not use this option. When set to true, an alternative way to close the popover with a keyboard must be provided. Default: `false`                                                                                                                                                                                                                                                                                              |
| `shouldCloseOnInteractOutside?` | `function`                         | When user interacts with the argument element outside of the popover ref, return true if onClose should be called. This gives you a chance to filter out interaction with elements that should not dismiss the popover. By default, onClose will always be called on interaction outside the popover ref.                                                                                                                                                                                                                    |
| `trigger?`                      | `string`                           | The name of the component that triggered the popover. This is reflected on the element as the `data-trigger` attribute, and can be used to provide specific styles for the popover depending on which element triggered it.                                                                                                                                                                                                                                                                                                  |
| `triggerRef?`                   | `object`                           | The ref for the element which the popover positions itself with respect to. When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc., this is set automatically. It is only required when used standalone.                                                                                                                                                                                                                                                                                      |
| `isEntering?`                   | `union`                            | Whether the popover is currently performing an entry animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `isExiting?`                    | `union`                            | Whether the popover is currently performing an exit animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `shouldSkipAnimation?`          | `union`                            | Whether the popover should appear and disappear without an entry or exit animation. This is used by components such as PreviewTrigger to skip animations when quickly swapping between overlays.                                                                                                                                                                                                                                                                                                                             |
| `offset?`                       | `number`                           | Distance in pixels between the trigger and the popover. Default: `4`                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `ref?`                          | `union`                            | Forwarded to the popover's DOM element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |


### SelectListBoxProps [#selectlistboxprops]

### SelectListBoxProps

Props for `SelectListBox`.

`SelectListBoxProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop                      | Type                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `aria-label?`             | `string`                           | Defines a string value that labels the current element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `aria-labelledby?`        | `string`                           | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `aria-describedby?`       | `string`                           | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `aria-details?`           | `string`                           | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `id?`                     | `string`                           | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                                                                                                                                                                                                                                                          |
| `selectionMode?`          | `union`                            | The type of selection that is allowed in the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `disallowEmptySelection?` | `union`                            | Whether the collection allows empty selection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `selectedKeys?`           | `union`                            | The currently selected keys in the collection (controlled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `defaultSelectedKeys?`    | `union`                            | The initial selected keys in the collection (uncontrolled).                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `onSelectionChange?`      | `function`                         | Handler that is called when the selection changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `items?`                  | `object`                           | Item objects in the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `disabledKeys?`           | `object`                           | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onFocus?`                | `function`                         | Handler that is called when the element receives focus.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onBlur?`                 | `function`                         | Handler that is called when the element loses focus.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `onFocusChange?`          | `function`                         | Handler that is called when the element's focus status changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `slot?`                   | `union`                            | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.                                                                                                                                                                                                                                                                                                             |
| `render?`                 | `DOMRenderFunction<"div", object>` | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `autoFocus?`              | `union`                            | Whether to auto focus the listbox or an option.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `shouldFocusWrap?`        | `union`                            | Whether focus should wrap around when the end/start is reached.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `escapeKeyBehavior?`      | `union`                            | Whether pressing the escape key should clear selection in the listbox or not. Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually. Default: `'clearSelection'`                                                                                                                                                                                 |
| `shouldSelectOnPressUp?`  | `union`                            | Whether selection should occur on press up instead of press down.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `shouldFocusOnHover?`     | `union`                            | Whether options should be focused when the user hovers over them.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `onAction?`               | `function`                         | Handler that is called when a user performs an action on an item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                                                                                                                                                                                                                                                                                                                                    |
| `children?`               | `union`                            | The contents of the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `dependencies?`           | `array`                            | Values that should invalidate the item cache when using dynamic collections.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `selectionBehavior?`      | `union`                            | How multiple selection should behave in the collection. Default: `'toggle'`                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `dragAndDropHooks?`       | `DragAndDropHooks<NoInfer<T>>`     | The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `renderEmptyState?`       | `function`                         | Provides content to display when there are no items in the list.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `layout?`                 | `union`                            | Whether the items are arranged in a stack or grid. Default: `'stack'`                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `orientation?`            | `union`                            | The primary orientation of the items. Usually this is the direction that the collection scrolls. Default: `'vertical'`                                                                                                                                                                                                                                                                                                                                                                                                       |


### SelectItemProps [#selectitemprops]

### SelectItemProps

Props for `SelectItem`.

`SelectItemProps` also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.

| Prop              | Type                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ----------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `href?`           | `string`                     | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `hrefLang?`       | `string`                     | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `target?`         | `union`                      | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `rel?`            | `string`                     | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `download?`       | `union`                      | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `ping?`           | `string`                     | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `referrerPolicy?` | `union`                      | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `onKeyDown?`      | `function`                   | Handler that is called when a key is pressed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `onKeyUp?`        | `function`                   | Handler that is called when a key is released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `onFocus?`        | `function`                   | Handler that is called when the element receives focus.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `onBlur?`         | `function`                   | Handler that is called when the element loses focus.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onFocusChange?`  | `function`                   | Handler that is called when the element's focus status changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `onHoverStart?`   | `function`                   | Handler that is called when a hover interaction starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `onHoverEnd?`     | `function`                   | Handler that is called when a hover interaction ends.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `onHoverChange?`  | `function`                   | Handler that is called when the hover state changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onPress?`        | `function`                   | Handler that is called when the press is released over the target.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `onPressStart?`   | `function`                   | Handler that is called when a press interaction starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `onPressEnd?`     | `function`                   | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `onPressChange?`  | `function`                   | Handler that is called when the press state changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onPressUp?`      | `function`                   | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `children?`       | `ChildrenOrFunction<object>` | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `render?`         | `function`                   | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Note: You can check if `'href' in props` in order to tell whether to render an `<a>` element. Requirements: - You must render the expected element type (e.g. if `<a>` is expected, you cannot render a `<button>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `id?`             | `union`                      | The unique id of the item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `textValue?`      | `string`                     | A string representation of the item's contents, used for features like typeahead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `aria-label?`     | `string`                     | An accessibility label for this item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `isDisabled?`     | `union`                      | Whether the item is disabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `onAction?`       | `function`                   | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `className?`      | `union`                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
