- Docs
- Components
- Backgrounds
- Eclipse
A dark shape eclipsing a soft, color-shifting corona of light
| Name | Type | Default | Description |
|---|---|---|---|
colors | [string, string] | ["#5227FF", "#FF9FFC"] | The two colours of the light, blended around the eclipse. The deep field colour is derived from the first. On light backgrounds they become matching inks. |
backgroundColor | string | "transparent" | Background of the component. Transparent reads the colour behind the component. |
shape | "circle" | "blob" | "triangle" | "diamond" | "pentagon" | "hexagon" | "circle" | The dark shape in front of the light. |
size | number | 0.36 | Radius of the shape as a share of the frame height. Larger values crop it. |
offsetX | number | 0 | Moves the eclipse sideways, as a share of the frame width. |
offsetY | number | 0 | Moves the eclipse down (positive) or up (negative), as a share of the frame height. |
rotation | number | 0 | Rotation of the shape, in degrees. |
spin | number | 2 | Slow rotation of the shape, in degrees per second. |
roundness | number | 0.2 | Rounds the corners of the polygon shapes. |
wobble | number | 0.03 | Slow organic breathing of the outline. |
lightAngle | number | -35 | Direction the light leaks from, in degrees (0 is right, 90 is up). |
lightOffset | number | 0.12 | How far the light sits behind the shape off-centre, which thickens the crescent on that side. |
corona | number | 1 | How far the glow spreads out from the shape. |
intensity | number | 1 | Brightness of the light. |
rim | number | 1 | Width of the coloured band of light just inside the shape's edge. |
softness | number | 0.2 | Blur of the shape's silhouette. |
contrast | number | 0.35 | How much brighter the lit side is than the far side. |
interior | number | 0 | Lets a sweep of colour show through the shape, like light behind smoked glass. |
streaks | number | 0 | Soft radial streaks running through the glow. |
ambient | number | 0.35 | Strength of the deep colour washing the space around the eclipse. |
speed | number | 1 | Speed of the drifting light, colour and outline. |
parallax | number | 0.5 | How far the light peeks around the shape toward the pointer. |
interactive | boolean | true | Click or tap to make the light flare out from that side of the shape. |
flareStrength | number | 1 | Brightness of the flare a click sends out, from 0 to 2. |
bloom | number | 0.5 | Soft glow around the brightest light. |
grain | number | 0.3 | Fine film grain over the lit areas. |
intro | boolean | true | The corona brightens and spreads out from the shape when the component appears. |
paused | boolean | false | Stops the motion. Reduced-motion users get a still eclipse. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
children | ReactNode | — | Content laid over the scene. Clicks on its links and buttons never trigger flares. |
ref | { flare, replay } | — | flare(angle?, strength?) sends a flare from an angle in degrees, replay() plays the intro again. |
className | string | — | Classes for the root element. It fills its parent, with a 320px minimum height. |
style | CSSProperties | — | Inline styles for the root element. |
colors[string, string]The two colours of the light, blended around the eclipse. The deep field colour is derived from the first. On light backgrounds they become matching inks.
["#5227FF", "#FF9FFC"]backgroundColorstringBackground of the component. Transparent reads the colour behind the component.
"transparent"shape"circle" | "blob" | "triangle" | "diamond" | "pentagon" | "hexagon"The dark shape in front of the light.
"circle"sizenumberRadius of the shape as a share of the frame height. Larger values crop it.
0.36offsetXnumberMoves the eclipse sideways, as a share of the frame width.
0offsetYnumberMoves the eclipse down (positive) or up (negative), as a share of the frame height.
0rotationnumberRotation of the shape, in degrees.
0spinnumberSlow rotation of the shape, in degrees per second.
2roundnessnumberRounds the corners of the polygon shapes.
0.2wobblenumberSlow organic breathing of the outline.
0.03lightAnglenumberDirection the light leaks from, in degrees (0 is right, 90 is up).
-35lightOffsetnumberHow far the light sits behind the shape off-centre, which thickens the crescent on that side.
0.12coronanumberHow far the glow spreads out from the shape.
1intensitynumberBrightness of the light.
1rimnumberWidth of the coloured band of light just inside the shape's edge.
1softnessnumberBlur of the shape's silhouette.
0.2contrastnumberHow much brighter the lit side is than the far side.
0.35interiornumberLets a sweep of colour show through the shape, like light behind smoked glass.
0streaksnumberSoft radial streaks running through the glow.
0ambientnumberStrength of the deep colour washing the space around the eclipse.
0.35speednumberSpeed of the drifting light, colour and outline.
1parallaxnumberHow far the light peeks around the shape toward the pointer.
0.5interactivebooleanClick or tap to make the light flare out from that side of the shape.
trueflareStrengthnumberBrightness of the flare a click sends out, from 0 to 2.
1bloomnumberSoft glow around the brightest light.
0.5grainnumberFine film grain over the lit areas.
0.3introbooleanThe corona brightens and spreads out from the shape when the component appears.
truepausedbooleanStops the motion. Reduced-motion users get a still eclipse.
falsedprnumberMaximum device pixel ratio for the canvas.
2childrenReactNodeContent laid over the scene. Clicks on its links and buttons never trigger flares.
—ref{ flare, replay }flare(angle?, strength?) sends a flare from an angle in degrees, replay() plays the intro again.
—classNamestringClasses for the root element. It fills its parent, with a 320px minimum height.
—styleCSSPropertiesInline styles for the root element.
—