# Kbd

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/kbd
- **Markdown:** https://refast.fastapicloud.dev/docs/components/kbd.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/typography/kbd.py
- **Applies to:** refast 0.12.2

Renders a keyboard key in a styled `<kbd>` element. Use it to document
keyboard shortcuts in help text and documentation.

```python
from refast.components import Kbd, Text

# Inline in prose
Text("Press ")
Kbd("⌘")
Text(" + ")
Kbd("K")
Text(" to open the command palette.")

# Single key
Kbd("Enter")
Kbd("Escape")
Kbd("Tab")
```

Open command palette

⌘

+

K

Save file

Ctrl

+

S

Undo

⌘

+

Z

Redo

⌘

+

Shift

+

Z

Find

Ctrl

+

F

Select all

⌘

+

A

Copy

⌘

+

C

Paste

⌘

+

V

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `key` | `str` | *(required)* | The key label to display |
| `id` | `str \| None` | `None` | Unique element ID |
| `class_name` | `str` | `""` | Extra Tailwind classes |

## Notes

`Kbd` is a pure display component — it renders the key label inside a styled
`<kbd>` HTML element. Combine multiple `Kbd` components with separator `Text`
(e.g. `"+"` or `"then"`) to represent key combinations.

## Common Key Symbols

| Symbol | Meaning |
|--------|---------|
| `⌘` | Command (macOS) |
| `⌃` | Control |
| `⌥` | Option / Alt |
| `⇧` | Shift |
| `⏎` | Return / Enter |
| `⌫` | Backspace |
| `⇥` | Tab |
| `⎋` | Escape |

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
