Krizaka UI
Krizaka UI
ComponentsFoundations

Kbd

A key or a keyboard shortcut, set as keys: one Kbd per key.

Web · ✓Mobile · n/aDesktop · ✓StableData display
Support level
Stable
Size
0.4 kB gzip, budget 0.4 kB
Who uses it
8 files of the live products and sites import it (krizaka.com: 2) Counted in the dated inventory of 2026-11-23.
import { Kbd } from "@krizaka/ui/kbd";
Change its props: the component re-renders, the code follows.
⌘K
size
tsx
<Kbd>⌘K</Kbd>

Web only — React, from @krizaka/ui/kbd. Stable: its API only changes in a major version.

  • Mobile · n/a. A phone has no keyboard shortcuts to show.

Why it is here. Used by Sovkora, Folioviv, krizaka.com.

When to use

  • To show a shortcut next to the action it runs: a menu item, a palette, a tooltip.
  • In help text: “Press Esc to close”.

When not to use

  • For code or a value the user types: use <code>.
  • For a status or a count.Use instead: Badge

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { Kbd } from "@krizaka/ui/kbd";

Examples

Key

A single key.

Esc

Small

size="sm", in menus and footers.

Esc

Shortcut

A shortcut in a sentence.

Search with ⌘K

Props

PropTypeDefaultDescription
size"sm" | "md"mdsm · md.

Accessibility

  • A <kbd> element: read as text. Spell out symbols a screen reader may skip (“Command K”) in the surrounding text when it matters.

Best practices

  • One Kbd per key: <Kbd>⌘</Kbd><Kbd>K</Kbd>, not <Kbd>⌘K</Kbd>.
  • Show the platform's modifier (⌘ on Apple, Ctrl elsewhere) when you know it.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page