CommandPalette
Searchable command menu dialog
Accessibility
- Ensure the trigger, popup role, and focus return behavior all describe the same interaction model.
- Provide an obvious keyboard dismissal path and avoid putting essential actions in hover-only content.
- Keep the opening control labeled, ensure focus moves predictably on open and close, and expose the popup type truthfully.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { CommandPalette } from '@dryui/ui';
</script>
<CommandPalette.Root>
<CommandPalette.Input>...</CommandPalette.Input>
<CommandPalette.List>...</CommandPalette.List>
<CommandPalette.Group>...</CommandPalette.Group>
<CommandPalette.Item>...</CommandPalette.Item>
<CommandPalette.Empty>...</CommandPalette.Empty>
<CommandPalette.Separator>...</CommandPalette.Separator>
</CommandPalette.Root> Import options
Root package
ts
import { CommandPalette } from '@dryui/ui' Per-component subpath
ts
import { CommandPalette } from '@dryui/ui/command-palette' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
CommandPalette.Root | |||||
| open | boolean | Whether the overlay or disclosure is currently open. | — | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
CommandPalette.Input | |||||
| placeholder | string | Hint text shown when no value is selected or entered. | — | — | — |
CommandPalette.List | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
CommandPalette.Group | |||||
| heading | string | — | — | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
CommandPalette.Item | |||||
| value | string | Current controlled or bindable value. | — | ✓ | — |
| disabled | boolean | Prevents interaction and applies disabled styling. | — | — | — |
| onSelect | () => void | Callback fired when the item is selected. | — | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
CommandPalette.Empty | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
CommandPalette.Separator | |||||