- Docs
- Components
- Backgrounds
- Glass & Chrome
- Glass Coins
Glowing glass coins that flip and flow in a seamless loop
| Name | Type | Default | Description |
|---|---|---|---|
colors | [string, string] | ["#5227FF", "#FF9FFC"] | Glass tint and light colour. The tint shows in the deep, see-through parts of each coin, the light colour in the bright rims and reflections. |
backgroundColor | string | "#0a0a0a" | Colour behind the coins. Dark backgrounds make the glass glow, light ones turn it into tinted glass. Pass transparent to pick up the colour of the page. |
pattern | "stream" | "ring" | "helix" | "wave" | "grid" | "vortex" | "float" | "stream" | How the coins are arranged: a diagonal stream flowing towards you, a ring, a helix, a row riding a wave, a grid, a spiral that grows outwards, or loosely scattered. |
count | number | 10 | Number of coins, from 1 to 40. |
size | number | 0.36 | Coin diameter relative to the shorter side of the frame. Patterns that must stay in view shrink to fit. |
thickness | number | 0.22 | Thickness of a coin relative to its diameter. |
bevel | number | 0.16 | Width of the cut along each edge, relative to the thickness. It catches the thin bright rim. |
spacing | number | 1 | Distance between neighbouring coins, measured in coin diameters. |
speed | number | 1 | Playback speed. One loop lasts five seconds at 1. Negative values play in reverse. |
turn | number | 90 | Resting angle of every coin in degrees. 0 faces you, 90 is edge on. |
spin | number | 0 | Half turns each coin makes per loop. Whole numbers keep the loop seamless. |
twist | number | 0 | Extra rotation from one coin to the next, in half turns, so a flip travels down the line. |
rock | number | 42 | How far each coin rocks back and forth around its resting angle, in degrees. |
ripple | number | 0.22 | Delay of the rocking from one coin to the next, in cycles. It also sets the wavelength of the wave pattern. |
drift | number | 1 | Places each coin travels along the pattern per loop. Whole numbers keep the loop seamless, 0 holds them still. |
sway | number | 1 | Sideways shape of the pattern: the bend of the stream, the width of the helix, the height of the wave. |
depth | number | 1 | How far the pattern reaches towards and away from you. 0 keeps every coin at the same distance. |
tilt | number | 12 | Leans every coin sideways, in degrees, so they do not sit perfectly square to the path. |
angle | number | 0 | Rotates the whole pattern in the plane of the screen, in degrees. |
pitch | number | 0 | Tips the whole pattern forwards or backwards, in degrees. |
yaw | number | 0 | Turns the whole pattern left or right, in degrees. |
centerX | number | 0 | Horizontal position of the pattern, from -1 (left edge) to 1 (right edge). |
centerY | number | 0 | Vertical position of the pattern, from -1 (top) to 1 (bottom). |
ior | number | 1.45 | Refractive index of the glass. Higher values bend light harder and brighten the reflections. |
dispersion | number | 0.5 | Colour fringing where light leaves the glass. 0 turns it off. |
density | number | 0.4 | How strongly the glass tints light that travels through it. |
frost | number | 0.2 | Satin finish on the rim, from polished (0) to frosted (1). The faces stay clear. |
glow | number | 1 | Bloom around the brightest highlights. |
intensity | number | 1 | Overall brightness of the lighting. |
lightAngle | number | 0 | Rotates the studio lighting around the view, in degrees. The key light starts at the upper left. |
interactive | boolean | true | Respond to the pointer and to touch. |
flick | number | 1 | How hard a coin spins when the pointer or a finger sweeps across it. Faster sweeps spin it further. 0 turns it off. |
pulse | number | 1 | Strength of the flip that spreads from a click or tap. 0 turns it off. |
parallax | number | 0.5 | How much the whole pattern leans towards the pointer. |
paused | boolean | false | Freeze the motion. Users who prefer reduced motion always get a still frame. |
quality | number | 1 | Render resolution from 0.25 to 1. It also lowers itself when frames run slow. |
ref | { pulse } | — | pulse(x, y) flips the coins outwards from a point, with x and y from 0 to 1 across the frame (the centre by default). |
children | ReactNode | — | Content placed over the coins. |
className | string | — | Classes for the root element. It fills its parent, with a 240px minimum height. |
style | CSSProperties | — | Inline styles for the root element. |
colors[string, string]Glass tint and light colour. The tint shows in the deep, see-through parts of each coin, the light colour in the bright rims and reflections.
["#5227FF", "#FF9FFC"]backgroundColorstringColour behind the coins. Dark backgrounds make the glass glow, light ones turn it into tinted glass. Pass transparent to pick up the colour of the page.
"#0a0a0a"pattern"stream" | "ring" | "helix" | "wave" | "grid" | "vortex" | "float"How the coins are arranged: a diagonal stream flowing towards you, a ring, a helix, a row riding a wave, a grid, a spiral that grows outwards, or loosely scattered.
"stream"countnumberNumber of coins, from 1 to 40.
10sizenumberCoin diameter relative to the shorter side of the frame. Patterns that must stay in view shrink to fit.
0.36thicknessnumberThickness of a coin relative to its diameter.
0.22bevelnumberWidth of the cut along each edge, relative to the thickness. It catches the thin bright rim.
0.16spacingnumberDistance between neighbouring coins, measured in coin diameters.
1speednumberPlayback speed. One loop lasts five seconds at 1. Negative values play in reverse.
1turnnumberResting angle of every coin in degrees. 0 faces you, 90 is edge on.
90spinnumberHalf turns each coin makes per loop. Whole numbers keep the loop seamless.
0twistnumberExtra rotation from one coin to the next, in half turns, so a flip travels down the line.
0rocknumberHow far each coin rocks back and forth around its resting angle, in degrees.
42ripplenumberDelay of the rocking from one coin to the next, in cycles. It also sets the wavelength of the wave pattern.
0.22driftnumberPlaces each coin travels along the pattern per loop. Whole numbers keep the loop seamless, 0 holds them still.
1swaynumberSideways shape of the pattern: the bend of the stream, the width of the helix, the height of the wave.
1depthnumberHow far the pattern reaches towards and away from you. 0 keeps every coin at the same distance.
1tiltnumberLeans every coin sideways, in degrees, so they do not sit perfectly square to the path.
12anglenumberRotates the whole pattern in the plane of the screen, in degrees.
0pitchnumberTips the whole pattern forwards or backwards, in degrees.
0yawnumberTurns the whole pattern left or right, in degrees.
0centerXnumberHorizontal position of the pattern, from -1 (left edge) to 1 (right edge).
0centerYnumberVertical position of the pattern, from -1 (top) to 1 (bottom).
0iornumberRefractive index of the glass. Higher values bend light harder and brighten the reflections.
1.45dispersionnumberColour fringing where light leaves the glass. 0 turns it off.
0.5densitynumberHow strongly the glass tints light that travels through it.
0.4frostnumberSatin finish on the rim, from polished (0) to frosted (1). The faces stay clear.
0.2glownumberBloom around the brightest highlights.
1intensitynumberOverall brightness of the lighting.
1lightAnglenumberRotates the studio lighting around the view, in degrees. The key light starts at the upper left.
0interactivebooleanRespond to the pointer and to touch.
trueflicknumberHow hard a coin spins when the pointer or a finger sweeps across it. Faster sweeps spin it further. 0 turns it off.
1pulsenumberStrength of the flip that spreads from a click or tap. 0 turns it off.
1parallaxnumberHow much the whole pattern leans towards the pointer.
0.5pausedbooleanFreeze the motion. Users who prefer reduced motion always get a still frame.
falsequalitynumberRender resolution from 0.25 to 1. It also lowers itself when frames run slow.
1ref{ pulse }pulse(x, y) flips the coins outwards from a point, with x and y from 0 to 1 across the frame (the centre by default).
—childrenReactNodeContent placed over the coins.
—classNamestringClasses for the root element. It fills its parent, with a 240px minimum height.
—styleCSSPropertiesInline styles for the root element.
—