SweetUI

Search items

Jump to an item

block

command-search

Composes command, keycap; caller owns query, filtering, sections, legend.

searchcommandpaletteshortcutsscreen
command-search, light

On iPad

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

command-search on iPad, light

Install

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

sweetui install command-search --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, command-search 0.2.1. Point --destination at a folder inside the consuming target's sources.

Usage

@State private var query = ""

CommandSearch(
    "Search",
    query: $query,
    prompt: "Search actions and activity",
    sections: sections,
    emptyDescription: Text("Try a payee, a card, or an action."),
    shortcuts: [
        CommandShortcutHint("Open search", keys: "⌘K", keysLabel: Text("Command K"))
    ],
    onSelect: { id in }
)

Accessibility contract

  • Field: prompt. Commands: Buttons, combined-label. Titles headers.
  • No results: ContentUnavailableView, copy, never blank.
  • Legend: action-shortcut merge; keycaps hidden unless labeled.
  • Selection/filtering/query caller-owned; no self-trigger.

Details

Kindblock
Version0.2.1
PlatformsiOS 26.0+
Dependenciescommand, kbd
SourceRegistry/sources/blocks/CommandSearch.swift
Xcode previewCommand Search