SweetUI

Search items

Jump to an item

component

command

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

commandpalettesearchspotlightshadcn
command, light

On iPad

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

command on iPad, light

Install

With the sweetui tool (brew install mangobyte-dev/tap/sweetui):

sweetui install command --destination Sources/YourFeature/Components

Installs 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

Kindcomponent
Version0.2.1
PlatformsiOS 26.0+
Dependenciesinput-group, item, kbd, empty, separator, button
SourceRegistry/sources/components/CommandPalette.swift
Xcode previewCommand Palette