A sunrise breaking over the glowing edge of a dark planet
| Name | Type | Default | Description |
|---|---|---|---|
colors | [string, string] | ["#FF9FFC", "#5227FF"] | The warm colour of the light near the surface and the cool colour of the upper atmosphere, blended in OKLab. On light backgrounds they become matching inks. |
backgroundColor | string | "transparent" | Background of the component. Transparent reads the colour behind the component. |
horizon | number | 0.72 | Height of the top of the planet, as a fraction of the frame from the top. |
curvature | number | 1 | How curved the horizon is: low values give a vast, nearly flat horizon, high values a small planet seen whole. |
tilt | number | 0 | Rotation of the view in degrees. 180 hangs the planet from the top, ±90 puts its edge at a side. |
sunPosition | number | 0.15 | Where along the horizon the sun rises, from -1 (left) to 1 (right). |
sunrise | number | 1 | Brightness of the sun breaking over the edge. 0 leaves only the lit atmosphere. |
spread | number | 0.4 | How far the sunlight spreads along the horizon. High values light the whole edge into a ring. |
atmosphere | number | 1 | Brightness of the glowing atmosphere above the edge. |
thickness | number | 1 | Height of the atmosphere. Low values give a crisp thin rim, high values a soft hazy glow. |
rim | number | 1 | Brightness of the razor-thin line of light along the edge. |
flare | number | 1 | Brightness of the sun's point of light and its glare. |
airglow | number | 0.5 | A faint second band of light floating above the atmosphere, like the airglow seen from orbit. |
clouds | number | 0.5 | Cloud tops catching the light just below the horizon near the sun. |
stars | number | 0.5 | Brightness of the faint twinkling stars. Hidden on light backgrounds. |
aurora | number | 1 | Strength of the aurora curtains that a click or tap raises from the horizon. 0 turns them off. |
autoAurora | boolean | false | Raise an aurora on its own every few seconds. |
speed | number | 0.5 | Speed of the slow motion: twinkling, airglow and drifting aurora rays. |
drift | number | 0.5 | How much the sun slowly wanders along the horizon. |
parallax | number | 0.5 | How much the view gently rolls and lifts toward the pointer, like a camera drifting in orbit. |
bloom | number | 0.5 | Soft glow around the brightest light on dark backgrounds. |
grain | number | 0.25 | Fine film grain over the lit areas. |
interactive | boolean | true | Pointer parallax, and clicking or tapping to raise an aurora where you click. |
intro | boolean | true | Play the sunrise when the component first appears: the light spreads along the edge as the sun breaks over it. |
paused | boolean | false | Stops the motion. Reduced-motion users get the risen sun, still. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
children | ReactNode | — | Content laid over the scene, such as a hero headline. Clicks on its links and buttons never raise an aurora. |
ref | { bloom, replay } | — | bloom(x?, strength?) raises an aurora above a horizontal position given as a fraction of the width; replay() replays the sunrise. |
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 warm colour of the light near the surface and the cool colour of the upper atmosphere, blended in OKLab. On light backgrounds they become matching inks.
["#FF9FFC", "#5227FF"]backgroundColorstringBackground of the component. Transparent reads the colour behind the component.
"transparent"horizonnumberHeight of the top of the planet, as a fraction of the frame from the top.
0.72curvaturenumberHow curved the horizon is: low values give a vast, nearly flat horizon, high values a small planet seen whole.
1tiltnumberRotation of the view in degrees. 180 hangs the planet from the top, ±90 puts its edge at a side.
0sunPositionnumberWhere along the horizon the sun rises, from -1 (left) to 1 (right).
0.15sunrisenumberBrightness of the sun breaking over the edge. 0 leaves only the lit atmosphere.
1spreadnumberHow far the sunlight spreads along the horizon. High values light the whole edge into a ring.
0.4atmospherenumberBrightness of the glowing atmosphere above the edge.
1thicknessnumberHeight of the atmosphere. Low values give a crisp thin rim, high values a soft hazy glow.
1rimnumberBrightness of the razor-thin line of light along the edge.
1flarenumberBrightness of the sun's point of light and its glare.
1airglownumberA faint second band of light floating above the atmosphere, like the airglow seen from orbit.
0.5cloudsnumberCloud tops catching the light just below the horizon near the sun.
0.5starsnumberBrightness of the faint twinkling stars. Hidden on light backgrounds.
0.5auroranumberStrength of the aurora curtains that a click or tap raises from the horizon. 0 turns them off.
1autoAurorabooleanRaise an aurora on its own every few seconds.
falsespeednumberSpeed of the slow motion: twinkling, airglow and drifting aurora rays.
0.5driftnumberHow much the sun slowly wanders along the horizon.
0.5parallaxnumberHow much the view gently rolls and lifts toward the pointer, like a camera drifting in orbit.
0.5bloomnumberSoft glow around the brightest light on dark backgrounds.
0.5grainnumberFine film grain over the lit areas.
0.25interactivebooleanPointer parallax, and clicking or tapping to raise an aurora where you click.
trueintrobooleanPlay the sunrise when the component first appears: the light spreads along the edge as the sun breaks over it.
truepausedbooleanStops the motion. Reduced-motion users get the risen sun, still.
falsedprnumberMaximum device pixel ratio for the canvas.
2childrenReactNodeContent laid over the scene, such as a hero headline. Clicks on its links and buttons never raise an aurora.
—ref{ bloom, replay }bloom(x?, strength?) raises an aurora above a horizontal position given as a fraction of the width; replay() replays the sunrise.
—classNamestringClasses for the root element. It fills its parent, with a 320px minimum height.
—styleCSSPropertiesInline styles for the root element.
—