component
command
Composes input group, rows, keycaps, empty state into search field.
commandpalettesearchspotlightshadcn

On iPad
The same installed source at a regular width. It adapts its layout without a separate design.


Install
With the sweetui tool (brew install mangobyte-dev/tap/sweetui):
sweetui install command --destination Sources/YourFeature/ComponentsInstalls in order: button 0.5.2, input-group 0.2.1, avatar 0.2.1, separator 0.2.1, badge 0.3.2, item 0.2.2, kbd 0.1.2, empty 0.1.1, command 0.2.1. Point --destination at a folder inside the consuming target's sources.
Usage
@State private var query = ""
CommandPalette(
query: $query,
prompt: "Search actions",
sections: [
CommandSection(id: "actions", title: "Actions", entries: [
CommandEntry(id: "transfer", title: Text("New transfer"), systemImage: "arrow.up.right", shortcut: "⌘T", shortcutLabel: Text("Command T"))
])
],
onSelect: { id in }
)Accessibility contract
- Field label: prompt; search-return key.
- Titles: headers. Commands: Buttons, title+detail; Voice Control by title.
- Keycaps: shortcutLabel or hidden; symbol decorative.
- No match: ContentUnavailableView, caller copy; filtering via query binding.
Details
| Kind | component |
| Version | 0.2.1 |
| Platforms | iOS 26.0+ |
| Dependencies | input-group, item, kbd, empty, separator, button |
| Source | Registry/sources/components/CommandPalette.swift |
| Xcode preview | Command Palette |