Skip to content
GitHub (opens in a new tab)

Kbd

A shortcut chip for one keyboard key. Place several in a row for a chord.

stableAtomcontracts/kbd.json

Preview

Kbd

A shortcut chip for one key. Put several in a row for a chord.

Master

One chip per key. The chord is the reading order.

⌘K

Usage

Use Kbd for the key name, not Badge. A chord is adjacent chips, not one chip with the whole shortcut.

Do's

  • Showing a keyboard shortcut next to an action or command
  • A single key or a chord such as ⌘ K

Don'ts

  • Status or category — use Badge
  • A control the person activates — use Button
  • A block of source code — use CodeSnippet
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>

In a sentence

Open the command menu with ⌘ K, or jump to search with /.

<p>Open the command menu with <Kbd>⌘</Kbd> <Kbd>K</Kbd>.</p>

When to use

  • Showing a keyboard shortcut next to an action or command
  • A single key or a chord such as ⌘ K

When not to use

  • Status or category — use Badge
  • A control the person activates — use Button
  • A block of source code — use CodeSnippet

What an agent reads

import { Kbd } from "agentic-ds-kit";
must
  • The element is a native kbd so the key name is exposed as keyboard input
  • Text content is the key label
  • A chord is several Kbd elements in reading order, not one chip with the whole chord
defaults
Nothing extra in the contract.
stops if
  • Do not invent KbdGroup
  • Do not use Badge or a styled span for keyboard keys
  • Do not use raw hex

From contracts/kbd.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
childrennodeYes—The key label, such as ⌘ or K.
  • Component
    →

    Badge

    Compact read-only status or category pill set by the system.

  • Component
    →

    Button

    Clickable action control with appearance × mode (plus an optional flat set) and a fixed set of sizes.

  • Component
    →

    CodeSnippet

    Read-only block of code with a copy button, optional title, language label, tabs, and line numbers.