SweetUI

Search items

Jump to an item

component

kbd

Styles Text as a keycap for shortcuts.

keyboardshortcutkeycaphintshadcn
kbd, light

On iPad

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

kbd on iPad, light

Install

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

sweetui install kbd --destination Sources/YourFeature/Components

Installs in order: kbd 0.1.2. Point --destination at a folder inside the consuming target's sources.

Usage

Text(verbatim: "⌘K")
    .registryKeycap(accessibilityLabel: Text("Command K"))

Text(verbatim: "esc")
    .registryKeycap()

Accessibility contract

  • Hidden unless accessibilityLabel given.
  • One line, intrinsic size. MUST NOT wrap.
  • Uses badge's compact radius, surface, border, spacing tokens.

Details

Kindcomponent
Version0.1.2
PlatformsiOS 26.0+
Dependenciesnone
SourceRegistry/sources/components/RegistryKeycapModifier.swift
Xcode previewKeycap