Keyboard Key
The <kbd> HTML element represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device.
Source code
Click to see the source code for this component on GitHub. Feel free to copy it and adjust it for your own use.
Installation
npx ui-thing@latest add kbd
Usage
<template>
<UiKbd>Ctrl</UiKbd>
</template>
Examples
Basic
⌘⇧⌥⌃
Ctrl+B
Group
Use the KbdGroup
component to group keyboard keys together.
Use
Ctrl + BCtrl + K
to open the command palette Button
Use the Kbd
component inside a Button
component to display a keyboard key inside a button.
Tooltip
You can use the Kbd
component inside a Tooltip
component to display a tooltip with a keyboard key.
Input Group
You can use the Kbd
component inside a InputGroupAddon
component to display a keyboard key inside an input group.
Sizes
Ctrl+B
Ctrl+B
Ctrl+B
Variants
Ctrl+B
Ctrl+B