Kbd

Keycap for shortcuts, on its own or grouped into a chord.

Source
1 file
Dependencies
none
Playground
yes

Examples

Every variant of the shipped component, live. Switch the layout to read them as a table or one at a time, and open Code for the file behind them.

01Basic
AEscEntercmd
02Variant
03Size
04Modifiers
fn
05Named keys
TabSpace
06Arrows
07Shortcut
+K
Ctrl+Shift+P
08Combined key
⌘ KCtrl S⇧ ⌘ P
09Custom color
K
10In text
Press
S
to save, or Esc to cancel

Installation

One package for the whole library — run this once and every component on this site is importable. Adding the tokens to your stylesheet is the other half; the installation guide covers it.

npm install kipui
import { Kbd, KbdGroup } from "kipui";
Peer dependencies

react 19

react-dom 19

tailwindcss 4

Bundled dependencies

None beyond the peers above.

Usage

kbd-example.tsx
import { Kbd, KbdGroup } from "kipui";

<KbdGroup>
  <Kbd></Kbd>
  <Kbd>K</Kbd>
</KbdGroup>
  • Use the platform's own glyphs (⌘, ⌥, ⇧) rather than spelling the modifiers out — that is what the key is labelled.

Playground

Change the props and the snippet underneath updates with them.

Preview

<Kbd />

Props

2
<Kbd size="md" variant="default"></Kbd>

API reference

Transcribed from the component's own types. Props with no default are required.

PropDefaultDescription
size"sm" | "md" | "lg""md"Cap size.
variant"default" | "outline" | "solid""default"Raised, outlined or high-contrast.