Skip to content
SENVENLI UI

Kbd

A keyboard key or shortcut shown as a keycap in help text, menus and tooltips.
Press Esc to close the panel.
A key in help text
import { Kbd } from "@senvenli/react/display";

Examples

A shortcut

`isModifier` shows ⌘ on Apple devices and Ctrl elsewhere.

Glyph keys

A screen reader may skip a glyph, so `label` says the key's name.

Guidelines

When to use it

  • Telling people which key or shortcut does something.

Use something else when

  • The label is a status, not a key. Badge
  • Code or a value is shown, not a key to press. Text

Accessibility

Built in

  • Kbd isModifier shows ⌘ on Apple platforms and Ctrl elsewhere.

You provide

  • A label for glyph keys a screen reader may skip ("Command" for ⌘).

API reference

Kbd

children
React.ReactNode

One key per Kbd; a shortcut is several Kbd separated by a space. Left out with isModifier.

isModifier
boolean

The platform's shortcut modifier: ⌘ on Apple platforms, Ctrl elsewhere (Ctrl on the server, settled after mount).

label
string

What a screen reader says instead of a glyph it may skip ("Command" for ⌘); the glyph is then hidden.