Kbd

A keyboard key component for displaying keyboard shortcuts and key combinations in documentation and UI.

Import
import { Kbd } from "@sugarcoat/ui-nxt";
Usage
<Kbd>Ctrl</Kbd> + <Kbd>C</Kbd>

Basic Usage#

Display individual keyboard keys.

Single Key

Key Combinations#

Show keyboard shortcuts with multiple keys.

Copy Shortcut
Save Shortcut
Undo Shortcut

Mac Shortcuts#

Display Mac-style keyboard shortcuts.

Mac Copy
Mac Save
Mac Screenshot

Special Keys#

Common special keys and symbols.

Special Keys
Arrow Keys

Function Keys#

Function Keys

In Context#

Using Kbd within documentation or UI text.

Documentation Context

Inline Usage#

Using Kbd within paragraph text.

Inline
Instructions

Props#

PropTypeDefaultDescription
childrenReactNode-Key label to display
size"1"-"12" | "normal" | "inherit"-Font size (inherited from typography)
weight"1"-"9" | "normal" | "bold" | "inherit"-Font weight (inherited from typography)

Common Key Symbols#

KeySymbolDescription
CommandMac Command key
OptionMac Option/Alt key
ShiftShift key
ControlControl key
ReturnReturn/Enter key
EscapeEscape key
DeleteDelete/Backspace key
TabTab key
Customize Theme
Build your own sugarcoat/ui theme
PresetLime / Violet / Slate
Brand ColorLime
Accent ColorViolet
Gray ScaleSlate
Border RadiusLg