Skip to content
satin

Kbd

A keyboard key, alone or as the keys of one shortcut.

Press⌘Kto search

Installation

Terminal
npm i @uisatin/ui
Import
import { Kbd } from '@uisatin/ui/kbd'

About 10.3 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The Kbd component renders a kbd element for one key. KbdGroup splits a shortcut such as "⇧⌘P" into keys 2px apart.

PropTypeDefault
size
"sm""md"
"sm"
tone
"default""inverse"
"default"
children
ReactNode
—
group.keys
stringReactNode[]
—
className
string
—
ref
Ref<HTMLElement>
—
...props
ComponentProps<'kbd'>

Other attributes go to <kbd>

—

Accessibility

A native kbd element, read as its text; screen readers may say symbols such as ⌘ in different ways. KbdArrowUp, KbdArrowDown and KbdReturn are hidden glyphs with no text, so add words for screen readers next to them, or hide the hint when the same help is spoken elsewhere.