[ Data Display ]
Kbd
Displays a keyboard key or shortcut, styled as a small raised keycap in the monospace font.
1 examplesDark modeAccessible
Import#
import { Kbd } from 'reusify-ui';When to use#
- Documenting keyboard shortcuts in menus, tooltips, search bars and docs.
Examples#
Shortcuts#
⌘KCtrl+Shift+PEsc
<Kbd>⌘</Kbd> <Kbd>K</Kbd>
<Kbd>Ctrl</Kbd> + <Kbd>Shift</Kbd> + <Kbd>P</Kbd>
<Kbd>Esc</Kbd>Used in designs#
Kbd in real layouts: this design uses it. Open one to try it and copy the code.
API reference#
<Kbd />
Renders a native <kbd> and accepts all its attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | The key label. |
children-ReactNodeThe key label.
Accessibility#
- Uses the semantic <kbd> element.