shadcn.io is not affiliated with official shadcn/ui
Kbd examples · Sizes
Extra Large Kbd for React
Extra large ⌘ and K key caps, 48 pixels tall with 2xl text.
A landing page hero or a presentation slide needs a shortcut that reads from across the room. This React example sizes both keys of a ⌘K KbdGroup with h-12 min-w-12 px-3 text-2xl: 48 pixels tall, at least as wide, with 2xl type. It's a display size for the one shortcut a page is about.
Preview
Installation
FAQ
When should I use extra large key caps?
When the shortcut is the headline: a hero that introduces a command palette, a launch page, a slide, a demo video. Anywhere else, the large or default size is enough.
What are the proportions of the extra large caps?
48 pixels tall and at least 48 wide, with 2xl type and wider padding. Height and minimum width stay equal so ⌘ and K are square, and the gap from KbdGroup stays small, so the two caps still read as one shortcut.
What contexts justify extra large key caps?
Marketing pages, feature announcements, keynote slides and screen recordings, where the shortcut is the message. In an app's own interface, they look out of scale next to everything else.
Should I use extra large caps on mobile?
Use a smaller size on narrow screens, for example by switching classes at a breakpoint. Two 48-pixel caps fit, but a longer shortcut won't, and most phones have no keyboard to press it on.
Related
- Large KbdLarge ⌘ and K key caps, 32 pixels tall
- Default KbdA ⌘K shortcut at the key cap's default
- Small KbdSmall ⌘ and K key caps, 16 pixels tall
- Inline with Text Kbd⌘ and K keys inline in a sentence about
- Command Palette Shortcut KbdThe ⌘K shortcut that opens a command
- Arrow Keys Cross Pattern KbdFour arrow keys in the inverted T of a