Kbd

Show a keyboard key or shortcut.

import { Kbd } from "@sagui/ui";
Markdown
Loading demo

When to use

  • Shortcut hints in menus, tooltips and search.

When not to use

  • Use Badge for status or counts.

Installation

Install the package and import the styles once. The installation guide covers the Tailwind setup.

$ npm install @sagui/ui

Usage

example.tsx
import { Kbd } from "@sagui/ui";

<Kbd keys={["⌘", "K"]} />

Accessibility

  • Renders kbd elements, so screen readers announce them as keys.

Also in data display