Components · Content
Kbd
A keyboard shortcut drawn as keys: keys: ["⌘", "K"]. Screen readers hear the keys as words ("Command K"). It stands alone; put it in a horizontal Box beside Text to label it.
ExamplesLink to this section
Search
Command K⌘KShow JSONHide JSON
{
"version": 1,
"root": "row",
"elements": {
"row": {
"type": "Box",
"props": { "direction": "horizontal", "align": "center", "gap": "sm" },
"children": ["what", "keys"]
},
"what": { "type": "Text", "props": { "text": "Search", "size": "sm" } },
"keys": { "type": "Kbd", "props": { "keys": ["⌘", "K"] } }
}
}Control Shift PCtrl⇧PEscapeEsc
Show JSONHide JSON
{
"version": 1,
"root": "box",
"elements": {
"box": {
"type": "Box",
"props": { "direction": "horizontal", "gap": "md", "wrap": true },
"children": ["palette", "close"]
},
"palette": { "type": "Kbd", "props": { "keys": ["Ctrl", "⇧", "P"] } },
"close": { "type": "Kbd", "props": { "keys": ["Esc"] } }
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| keysrequired | string[] | 1–6 items |
RulesLink to this section
- Each entry of
keysis one key (up to 6 keys, 20 characters each). Symbols and short forms are read as words: ⌘ Command, ⌥ Option, ⇧ Shift, ⌃ or Ctrl Control, ↵ Enter, ⎋ or Esc Escape, the arrows by direction. Any other key is read as written. - A Kbd stands alone. To label it, put it in a horizontal Box beside Text.
Children and eventsLink to this section
Kbd is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.