Kbd
Kbd is used to display keyboard shortcuts and key combinations. Perfect for documentation and help interfaces.
Basic Example
Keyboard keys with different sizes
const { default: Kbd } = await import('/components/data-display/kbd.js');
const { tags, $ } = Lightview;
const { div, span } = tags;
const shortcuts = div({ class: 'space-y-4' },
div({ class: 'flex gap-2 items-center' },
span({}, 'Save: '),
Kbd({}, '⌘'),
Kbd({}, 'S')
),
div({ class: 'flex gap-2 items-center' },
span({}, 'Undo: '),
Kbd({}, '⌘'),
Kbd({}, 'Z')
),
div({ class: 'flex gap-2 items-center' },
span({}, 'Copy: '),
Kbd({}, '⌘'),
Kbd({}, 'C')
)
);
$('#demo').insert(shortcuts);
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size |
string | - | 'xs' | 'sm' | 'md' | 'lg' |
Sizes
Shift
Ctrl
Alt
Esc
Keyboard Shortcut
⌘
⌥
⇧
P
Full Keyboard Row
q
w
e
r
t
y
u
i
o
p
For more examples, see the
DaisyUI Kbd documentation.