Command
Cmdk-style command palette.
packages/ui/src/components/ui/command.tsx
Import
Subpath export:
@marktiderman/genesis-uiimport { Command } from "@marktiderman/genesis-ui";Exports
Re-exported from
@marktiderman/genesis-ui.- Command
- CommandDialog
- CommandInput
- CommandList
- CommandEmpty
- CommandGroup
- CommandItem
Components
Auto-generated from TypeScript source via
react-docgen-typescript.Command
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| disablePointerSelection | boolean | — | Optionally set to `true` to disable selection via pointer events. |
| filter | CommandFilter | — | Custom filter function for whether each command menu item should matches the given search query. It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely. By default, uses the `command-score` library. |
| label | string | — | Accessible label for this command menu. Not shown visibly. |
| loop | boolean | — | Optionally set to `true` to turn on looping around when using the arrow keys. |
| onValueChange | ((value: string) => void) | — | Event handler called when the selected item of the menu changes. |
| shouldFilter | boolean | — | Optionally set to `false` to turn off the automatic filtering and sorting. If `false`, you must conditionally render valid items based on the search query yourself. |
| value | string | — | Optional controlled state of the selected command menu item. |
| vimBindings | boolean | — | Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`. |
CommandDialog
No declared props.
CommandInput
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| onValueChange | ((search: string) => void) | — | Event handler called when the search value changes. |
| value | string | — | Optional controlled state for the value of the search input. |
CommandList
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| label | string | — | Accessible label for this List of suggestions. Not shown visibly. |
CommandEmpty
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — |
CommandGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| forceMount | boolean | — | Whether this group is forcibly rendered regardless of filtering. |
| heading | ReactNode | — | Optional heading to render for this group. |
| value | string | — | If no heading is provided, you must provide a value that is unique for this group. |
CommandItem
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| disabled | boolean | — | Whether this item is currently disabled. |
| forceMount | boolean | — | Whether this item is forcibly rendered regardless of filtering. |
| keywords | string[] | — | Optional keywords to match against when filtering. |
| onSelect | ((value: string) => void) | — | Event handler for when this item is selected, either via click or keyboard selection. |
| value | string | — | A unique value for this item. If no value is provided, it will be inferred from `children` or the rendered `textContent`. If your `textContent` changes between renders, you _must_ provide a stable, unique `value`. |
CommandShortcut
No declared props.
CommandSeparator
| Prop | Type | Default | Description |
|---|---|---|---|
| alwaysRender | boolean | — | Whether this separator should always be rendered. Useful if you disable automatic filtering. |
| asChild | boolean | — |