Measured entry
shadcn-kbd
A small copy-in React component for rendering keyboard keys and grouped shortcuts. It ships through the shadcn registry as Tailwind-styled source, uses the project cn helper, and relies on clsx, tailwind-merge, and shadcn-style semantic color tokens rather than a runtime provider.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 1 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 29.1 KB (94.6 KB build, 65.5 KB baseline) |
| Bare mode | OK |
| Provider required | NO |
| Demo used | written from the component source API |
Verdict
A focused, low-complexity keycap primitive that builds and mounts without a provider. It is a sensible fit for shadcn-based interfaces, but the default muted styling needs a contrast review before production use.
Use it if
- You need consistent keycap labels beside commands, menu items, or shortcut documentation.
- Your React app already uses Tailwind and shadcn semantic theme tokens.
- You want source-owned styling that can be adjusted locally without adopting a component runtime.
Skip it if
- Your design system cannot accommodate Tailwind utility classes or shadcn semantic tokens.
- You need an interactive shortcut recorder or keyboard event handling rather than a visual label.
- You cannot revise the muted foreground styling, which triggered a serious color contrast finding in the tested demo.
Install
| Declared dependencies | clsx, tailwind-merge |
|---|---|
| Missing on install | none |
| Bare install | builds and mounts without the shadcn-style helpers |
| Provider | no provider required in the harness |
In a non-shadcn project, add Tailwind, define the muted and foreground theme tokens, provide a cn utility backed by clsx and tailwind-merge, and replace the source alias if your project does not map it. Adjust the muted text color to meet your contrast standard.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/shadcn-ui/uiAlternatives
Other published entries for the badge pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- neu-badgeneumorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 17.5KB
- Bare
- pass
- Prov
- NO
- clay-badgeclaymorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 17.9KB
- Bare
- pass
- Prov
- NO
- ruixen-load-rippleunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 17.9KB
- Bare
- pass
- Prov
- NO
- kibo-listminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 42.4KB
- Bare
- pass
- Prov
- NO
- ruixen-blurred-stagger-textunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 58.1KB
- Bare
- pass
- Prov
- NO
- tripled-auto-revealing-heading-shadcnuiminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 58.3KB
- Bare
- pass
- Prov
- NO