Components
Kbd
Apple 27 Liquid Glass keyboard shortcut keycaps with default Liquid Glass standalone rendering, glass={false} opaque fallback, and automatic Over-Glass flat styling inside glass surfaces or tooltips.
Fully compatible with the standard shadcn/ui JSX API (Kbd / KbdGroup):
- Default Liquid Glass keycaps: Mounts a
small<LiquidSurfaceBackdrop>reacting to the global glass tint with SDF edge refraction when standalone; passglass={false}for 100% opaque keycaps. - Automatic Over-Glass adaptation: Inside glass surfaces (
Card,Tooltip,InputGroup,Command,Dialog, etc.), automatically switches to flat Over-Glass keycaps to avoid glass-on-glass stacking;KbdGrouppropagatesglassto child keycaps. - Responsive sizing: 22px (
6pxradius) on mobile ↔ 20px (5pxradius) on desktop.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/kbdUsage
import { Kbd, KbdGroup } from '@/components/ui/kbd';
export function Example() {
return (
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>
);
}Props API
Kbd
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Liquid Glass keycap reacting to global tint; false renders a 100% opaque keycap; auto-switches to flat Over-Glass inside glass surfaces |
surface | 'default' | 'over-glass' | Auto-detected | Manually override surface context |
KbdGroup
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Propagates default glass setting to child <Kbd> elements |
Item
Apple 27 list row cell inspired by iOS Settings rows, combining icons, titles, descriptions, and trailing controls with Inset Grouped styling and link press feedback.
Label
Apple 27 form label sized 15px (iOS Subheadline) on mobile ↔ 13px on desktop, automatically dimming when its paired control or group is disabled.