- Docs
- Components
- Backgrounds
- Glass & Chrome
- Glass Keys
A grid of glass keycaps that type, ripple and light up under the pointer
| Name | Type | Default | Description |
|---|---|---|---|
colors | [string, string] | ["#5227FF", "#FF7A27"] | Glass colour and light colour. The glass colour tints the body; the light colour warms the highlights and the backlight. |
backgroundColor | string | "#0a0a0a" | Colour behind the keys. Light backgrounds switch to a frosted, ink-like look. |
size | number | 0.44 | Key width as a fraction of the frame's shorter side. |
spacing | number | 0.32 | Gap between keys as a fraction of a key. |
stagger | number | 0 | Shifts each row sideways like a keyboard, as a fraction of a key. |
height | number | 0.5 | Keycap height as a fraction of its width. |
taper | number | 0.72 | Width of the top compared with the base. |
radius | number | 0.08 | Corner radius of the keycap as a fraction of its width. |
bevel | number | 0.05 | Roundness of the top edge, as a fraction of the key width. |
dish | number | 0.04 | How deeply the top curves inward. 0 is flat. |
legends | boolean | true | Prints a keyboard letter on each key. Pressed keys light it from below. |
tilt | number | 42 | How far the camera looks down on the keys, in degrees. 90 is straight down. |
angle | number | 28 | Rotation of the grid around its vertical axis, in degrees. |
centerX | number | 0 | Moves the grid sideways, as a fraction of the frame width. |
centerY | number | 0 | Moves the grid up or down, as a fraction of the frame height. |
ior | number | 1.5 | Index of refraction. Higher values bend light more inside the glass. |
dispersion | number | 1.6 | How far the colours split at edges and bevels. |
density | number | 1 | How strongly the glass colour tints light passing through. 0 is clear glass. |
frost | number | 0 | Softens reflections and refraction like frosted glass. |
glow | number | 1 | Strength of the soft bloom around bright highlights. |
backlight | number | 1 | Brightness of the light under each key that shows when it is pressed. |
intensity | number | 1 | Overall exposure. |
lightAngle | number | 0 | Starting rotation of the lights around the scene, in degrees. |
lightSpeed | number | 4 | How fast the lights drift around the keys, in degrees per second. 0 holds them still. |
blur | number | 0.6 | Depth of field. Keys nearer and farther than the focus soften like a macro photo. 0 keeps everything sharp. |
focus | number | 0.5 | Height of the sharp band, from 0 (top of the frame) to 1 (bottom). |
grain | number | 0.3 | Film grain over the lit keys. |
typing | number | 1 | Speed of the idle typing, in bursts of key presses. 0 turns it off. |
ripples | number | 7 | Seconds between idle ripples across the keys. 0 turns them off. |
travel | number | 0.32 | How far a key sinks when pressed, as a fraction of its height. |
interactive | boolean | true | Keys press under the pointer, and a click sends a ripple. |
pulse | number | 1 | Strength of the click ripple. |
parallax | number | 0.5 | How much the grid leans toward the pointer. |
intro | boolean | true | Keys rise into place across the grid the first time it comes into view. |
paused | boolean | false | Freezes the animation. |
quality | number | 1 | Render resolution scale, from 0.25 to 1. It also drops automatically on slow devices. |
ref | { pulse, type, replay } | — | Sends a ripple from a point (0 to 1 on each axis), types a burst of keys, or replays the intro. |
children | ReactNode | — | Content layered above the keys. |
className | string | — | Classes for the root element. |
style | CSSProperties | — | Inline styles for the root element. |
colors[string, string]Glass colour and light colour. The glass colour tints the body; the light colour warms the highlights and the backlight.
["#5227FF", "#FF7A27"]backgroundColorstringColour behind the keys. Light backgrounds switch to a frosted, ink-like look.
"#0a0a0a"sizenumberKey width as a fraction of the frame's shorter side.
0.44spacingnumberGap between keys as a fraction of a key.
0.32staggernumberShifts each row sideways like a keyboard, as a fraction of a key.
0heightnumberKeycap height as a fraction of its width.
0.5tapernumberWidth of the top compared with the base.
0.72radiusnumberCorner radius of the keycap as a fraction of its width.
0.08bevelnumberRoundness of the top edge, as a fraction of the key width.
0.05dishnumberHow deeply the top curves inward. 0 is flat.
0.04legendsbooleanPrints a keyboard letter on each key. Pressed keys light it from below.
truetiltnumberHow far the camera looks down on the keys, in degrees. 90 is straight down.
42anglenumberRotation of the grid around its vertical axis, in degrees.
28centerXnumberMoves the grid sideways, as a fraction of the frame width.
0centerYnumberMoves the grid up or down, as a fraction of the frame height.
0iornumberIndex of refraction. Higher values bend light more inside the glass.
1.5dispersionnumberHow far the colours split at edges and bevels.
1.6densitynumberHow strongly the glass colour tints light passing through. 0 is clear glass.
1frostnumberSoftens reflections and refraction like frosted glass.
0glownumberStrength of the soft bloom around bright highlights.
1backlightnumberBrightness of the light under each key that shows when it is pressed.
1intensitynumberOverall exposure.
1lightAnglenumberStarting rotation of the lights around the scene, in degrees.
0lightSpeednumberHow fast the lights drift around the keys, in degrees per second. 0 holds them still.
4blurnumberDepth of field. Keys nearer and farther than the focus soften like a macro photo. 0 keeps everything sharp.
0.6focusnumberHeight of the sharp band, from 0 (top of the frame) to 1 (bottom).
0.5grainnumberFilm grain over the lit keys.
0.3typingnumberSpeed of the idle typing, in bursts of key presses. 0 turns it off.
1ripplesnumberSeconds between idle ripples across the keys. 0 turns them off.
7travelnumberHow far a key sinks when pressed, as a fraction of its height.
0.32interactivebooleanKeys press under the pointer, and a click sends a ripple.
truepulsenumberStrength of the click ripple.
1parallaxnumberHow much the grid leans toward the pointer.
0.5introbooleanKeys rise into place across the grid the first time it comes into view.
truepausedbooleanFreezes the animation.
falsequalitynumberRender resolution scale, from 0.25 to 1. It also drops automatically on slow devices.
1ref{ pulse, type, replay }Sends a ripple from a point (0 to 1 on each axis), types a burst of keys, or replays the intro.
—childrenReactNodeContent layered above the keys.
—classNamestringClasses for the root element.
—styleCSSPropertiesInline styles for the root element.
—