Data display

Kbd

Keyboard keys and key combinations on the native kbd element.

Class nameTypeDescription
kbdplf:kbdComponentA keyboard key
kbd-groupplf:kbd-groupPartThe keys of one combination
K Ctrl Shift Enter Esc

Key combinations

Hide the separators with aria-hidden="true".

CtrlK Ctrl Shift P

Modifier symbols

Hide the symbol and give its name with sr-only.

Command Shift Option Control

Inside a button

Hide the key with aria-hidden="true", so the button’s name stays the action.

Inside a tooltip

Tooltip needs its script.

React

Kbd from @pelatform/react renders a key, and its part KbdGroup the keys of one combination, both on the native kbd element. Their props are a kbd element’s, className and ref included.

CSS variables

Override on a root, a group or a single key; set on a group, they reach its keys.

Variable Default
--plf-kbd-bg Muted surface
--plf-kbd-color Muted text on keys; the surrounding text color on groups
--plf-kbd-border Transparent
--plf-kbd-height 1.25rem (20px), the minimum height and width
--plf-kbd-radius Medium radius (6px)
--plf-kbd-font-size 12px
--plf-kbd-gap Space 1, between keys in a group
Command K

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons