Skip to main content

Kbd

Kbd is a decorative element used to represent specific keyboard keys. It is typically embedded inside components (e.g., menu, table, button) or paragraph text, to communicate an associated keyboard shortcut or a user instruction.

Also known as: Key
Salt package@salt-ds/core
Available since1.58.0

Kbd supports multiple background color variants: primary, secondary, and tertiary. The primary variant is set by default. These variants help match different UI backgrounds and provide varying levels of visual emphasis, depending on how important the shortcuts are in a given scenario.

Kbd can be used inline within text to indicate keyboard shortcuts as part of a sentence.

Kbd can be placed inside an input field as an adornment to indicate a shortcut or expected key input

Kbd can be used within a menu or context menu to visually display keyboard shortcuts alongside menu items, helping users quickly identify available shortcut keys for each action.