Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
Command | CommandDialog ├── CommandInput └── CommandList ├── CommandEmpty ├── CommandGroup │ ├── CommandGroupLabel │ └── CommandItem │ ├── CommandItemText │ └── CommandShortcut (optional) └── CommandSeparator (optional)
Examples
Default
Loading...
Dialog
Loading...
Empty
Loading...
In A Popover
Loading...
Nested Pages
Loading...
With Tabs
Loading...
Workspace Switcher
Loading...
API Reference
Command
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Unique identifier used to connect the component parts. |
orientation | "horizontal" | "vertical" | undefined | "horizontal" | Sets the component orientation and keyboard navigation axis. |
ids | ElementIds | undefined | — | Overrides generated identifiers for individual parts. |
disabled | boolean | undefined | false | Disables interaction with the component. |
disallowSelectAll | boolean | undefined | — | Configures disallow select all. |
onHighlightChange | ((details: HighlightChangeDetails<T>) => void) | undefined | — | Runs when highlight changes. |
onValueChange | ((details: ValueChangeDetails<T>) => void) | undefined | — | Runs when value changes. |
value | string[] | undefined | — | Current value when the component is controlled. |
defaultValue | string[] | undefined | — | Initial value when the component is uncontrolled. |
highlightedValue | string | null | undefined | — | Configures highlighted value. |
defaultHighlightedValue | string | null | undefined | — | Configures default highlighted value. |
loopFocus | boolean | undefined | — | Configures loop focus. |
selectionMode | SelectionMode | undefined | — | Configures selection mode. |
scrollToIndexFn | ((details: ScrollToIndexDetails) => void) | undefined | — | Configures scroll to index fn. |
selectOnHighlight | boolean | undefined | — | Configures select on highlight. |
deselectable | boolean | undefined | — | Configures deselectable. |
typeahead | boolean | undefined | — | Configures typeahead. |
onSelect | ((details: SelectionDetails) => void) | undefined | — | Runs when select changes. |
Context, Hooks, and Types
| Export | API |
|---|---|
useListCollection | Creates or accesses the component API. |
Utilities and Supporting Types
| Export | API |
|---|---|
createListCollection | Creates the typed collection consumed by the component. |
Angular
React
Solid
Svelte
Vue