An animated, interactive SVG keyboard illustration with configurable themes, colors, and layouts.
Install the component:
Usage:
app/page.jsx
1<ClavisKeyboard2 theme="dark"3 color="var(--color-main)"4 typing="amines"5/>| Prop | Type | Default | Description | Required |
|---|---|---|---|---|
| theme | "dark" | "light" | "dark" | Selects the base keyboard palette; an unrecognized value uses the dark theme. | No |
| color | string | "#ff6b35" | CSS color for the accent keys, glow, and press highlights. Accepts CSS colors including hex, rgb, hsl, and var() values. | No |
| keyColor | string | undefined (uses the selected theme's key color) | CSS color override for regular key caps. | No |
| caseColor | string | undefined (uses the selected theme's case color) | CSS color override for the keyboard case and plate. | No |
| legendColor | string | undefined (uses the selected theme's legend color) | CSS color override for the key legends. | No |
| accentKeys | string[] | ["esc", "return"] | Key labels to render with the accent color. Pass an empty array to disable accent keys. | No |
| glow | boolean | true | Shows the soft accent-colored glow behind the keyboard. | No |
| legends | boolean | true | Shows labels on the keys, except for the space key. | No |
| fontFamily | string | ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif | CSS font-family used for the key legends. | No |
| layout | "full" | "compact" | "full" | Selects the built-in five-row full keyboard or four-row compact keyboard. Ignored when rows is provided. | No |
| rows | Array<Array<string | [label: string, width: number]>> | undefined (uses the selected built-in layout) | Custom rows replace the built-in layout. Each row is an array of key labels; each key is a string with width 1 or a [label, width] tuple. Width is measured in key units, where 1 is a standard key, and rows are centered. | No |
| typing | string | false | "amines" | Text to type repeatedly. Set false to disable automatic typing. Characters map to matching key labels; spaces map to space, newlines map to return, and unmatched characters are skipped. | No |
| typingSpeed | number | 280 | Automatic typing interval in milliseconds per keystroke. | No |
| interactive | boolean | true | Enables pointer hover, click, and touch presses on keys. | No |
| onKeyPress | (label: string) => void | undefined | Callback invoked with the key label when a key is pressed by pointer interaction or automatic typing. | No |
| title | string | "Keyboard" | Accessible name applied to the rendered SVG illustration. | No |
| className | string | undefined | CSS class applied to the rendered SVG. | No |
| style | CSSProperties | undefined | Inline styles applied to the rendered SVG. | No |
| ...rest | SVGProps<SVGSVGElement> | undefined | Additional native SVG attributes and event handlers are forwarded to the rendered SVG. | No |