KBD
Keyboard key component with relief and an active state, plus a shortcut helper such as Ctrl + K.
How to use it
Run npx @blossomui/react add kbd, or copy src/components/UI/KBD/Kbd.tsx into your React project and import it.
import { Kbd, KbdShortcut } from './components/ui/Kbd'Props
KbdProps
| Prop | Type | Description |
|---|---|---|
| size | KbdSize | `sm` is smaller and fits inside a button or a bar of 40 px. |
| className | string | Extra classes of the key. |
| children (required) | ReactNode | |
| color | KbdColor | (string & {}) | Color of the key: a preset, `accent` for the brand color or any CSS color. `default` is a neutral gray. |
| relief | boolean | Adds a thicker bottom border so the key looks pressable. |
| active | boolean | Highlights the key, useful to show that it is being pressed. Uses the color of the key, or pink for `default`. |
KbdShortcutProps
| Prop | Type | Description |
|---|---|---|
| keys (required) | string[] | |
| size | KbdSize | |
| className | string | Extra classes of the row of keys. |
| color | KbdColor | (string & {}) | A preset or any CSS color. |
| relief | boolean |