Compose the search and the list.
palette.tsx
Command
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| items | readonly ItemValue[] | — | The data to filter: a flat array, or groups ({ value, items }). Nullish entries are not allowed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size | "default""lg" | "default" | default, or lg for a Spotlight-style palette: a 44px search row with a 20px icon, 36px rows with 8px padding and gaps, a 6px list inset, and a 36px footer. Text stays 14px. The parts read it from the root (data-size). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UICombobox.RootBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name | string | — | Identifies the field when a form is submitted. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | The id of the component. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CommandDialog
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||
| show | boolean | false | Show the corner close button. Default false: Escape closes the palette. | ||||||||||||||||||||||||||||||||||
| close | string | "Close" | The accessible name of the close button. Translate it with the page. | ||||||||||||||||||||||||||||||||||
| container | — | The element the dialog portals into (Base UI Dialog.Portal container). | |||||||||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||||||||||
From Base UIDialog.RootBase UI docs | |||||||||||||||||||||||||||||||||||||
| open | boolean | — | Whether the dialog is currently open. | ||||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the dialog is initially open. To render a controlled dialog, use the open prop instead. | ||||||||||||||||||||||||||||||||||
| modal | "trap-focus" | boolean | true | Determines if the dialog enters a modal state when open. - true: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - false: user interaction with the rest of the document is allowed. - 'trap-focus': focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled. When modal is true or 'trap-focus', render <Dialog.Close> inside <Dialog.Popup> so touch screen readers can escape the popup. | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
CommandInput
<input>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| show | boolean | true | Show the clear button while the field has text. Default true. |
| clear | string | "Clear search" | The accessible name of the clear button. Translate it with the page. |
From Base UICombobox.InputBase UI docs | |||
| disabled | boolean | false | Whether the component should ignore user interaction. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <input> attributes | — | Every other attribute goes to the <input>, with a ref. |
CommandList
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UICombobox.ListBase UI docs | |||
| children | — | ||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CommandEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CommandGroup
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| heading | ReactNode | — | The group name (the shadcn heading): the shared popup group label, 12/16 weight 500 muted. |
From Base UICombobox.GroupBase UI docs | |||
| items | readonly any[] | — | Items to be rendered within this group. When provided, child Collection components will use these items. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CommandCollection
| Prop | Type | Default | Description |
|---|---|---|---|
From Base UICombobox.CollectionBase UI docs | |||
| children | — | ||
CommandItem
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||
From Base UIAutocomplete.ItemBase UI docs | |||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||
| on | — | An optional click handler for the item when selected. It fires when clicking the item with the pointer, as well as when pressing Enter with the keyboard if the item is highlighted when the Input or List element has focus. | |||||||||||||||||||||||||||
| index | number | — | The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM. | ||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||
CommandShortcut
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CommandSeparator
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIAutocomplete.SeparatorBase UI docs | |||
| orientation | "horizontal""vertical" | 'horizontal' | The orientation of the separator. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CommandFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| UporDown | Moves the lit row. |
|---|---|
| Enter | Runs the lit row. |
| Escape | Closes the dialog. |
- Animated Close IconA cross for Close and Dismiss buttons. It wiggles once when you hover or focus the button.
- AutocompletePick Autocomplete for a text field in a form that suggests values while people type.
- DialogA window over the page for one task, such as a short form or a detail view. The page behind waits until people close it.
- MenuPick Menu for a short list of actions that opens from a button, with no search field.
- ComboboxPick Combobox for a value in a form that must be one item from the list.
- Search FieldPick Search Field for a plain search query in one line that filters a page, with no list of commands.
Built with
Installs with Command
- Components
- Autocomplete,Dialog,Menu









