Launch sale — 60% off Pro
Contact
kbdPressed State

Not affiliated with official shadcn/ui. Visit ui.shadcn.com for official docs.

React kbd - Active State

A React keyboard shortcut showing active/pressed key state with bg-primary styling using shadcn/ui Kbd component to indicate currently pressed keys

Looking to implement shadcn/ui patterns?

Join our Discord community for help from other developers.


When documenting interactive shortcuts, static keys aren't enough. This React pattern shows KbdGroup with active state on the Cmd key using bg-primary and text-primary-foreground classes—visually indicates which key is currently pressed. Built with shadcn/ui Kbd components, it's perfect for interactive tutorials, keyboard trainers, shortcut demonstrations, onboarding flows, or any interface showing real-time key press states to teach users keyboard combinations.

K

Pattern created by @haydenbleasel

Installation

Questions you might have