Primitive / Atomstable
Kbd
Keyboard keycap primitive for shortcuts and key hints.
@glinui/uiComponent: kbd
Installation
Install from the package for shared ownership or from the registry for copy-paste control.
Package Manager
pnpm add @glinui/ui @glinui/tokensRegistry
pnpm dlx @glinui/cli@latest add kbdUsage
Open command palette:cmdK
TSX
1import { Kbd } from "@glinui/ui"23export function Demo() {4 return (5 <div className="flex items-center gap-2 text-sm">6 <span>Open command palette:</span>7 <Kbd>cmd</Kbd>8 <Kbd>K</Kbd>9 </div>10 )11}
Accessibility
- Uses semantic `<kbd>` element for keyboard shortcuts.
Reduced Motion
No motion-dependent behavior.
API Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | "default" | "glass" | "outline" | "ghost" | No | default | Surface treatment. |
size | "sm" | "md" | "lg" | No | md | Keycap size. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/kbd.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-02-19T17:59:28.468Z · Full index: /docs/api-metadata
Primary Props Type
KbdProps
KbdProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from kbdVariants. |
variant | "default" | "glass" | "outline" | "ghost" | No | "default" | Variant option from kbdVariants. |