- Docs
- Components
- Backgrounds
- Simple Swirl
A soft, glowing swirl you can spin with momentum
| Name | Type | Default | Description |
|---|---|---|---|
swirlColor | string | "#5227FF" | Main colour of the swirl and its arms. |
glowColor | string | "auto" | Colour the brightest arms and the core heat toward. Auto derives a lighter tone from the swirl colour. |
backgroundColor | string | "transparent" | Fill behind the swirl. Transparent reads the page behind it. Light colours switch to an ink rendering. |
arms | number | 4 | Number of spiral arms, from 3 to 8. |
speed | number | 1 | Speed of the idle turn. |
direction | number | 1 | Turn direction. 1 is clockwise, -1 is counter-clockwise. |
zoom | number | 0.32 | Zoom into the swirl. Higher values make it smaller. |
layers | number | 20 | How far the stacked layers reach, up to 30. |
layerStep | number | 0.13 | Spacing between layers. Smaller steps give a denser swirl. |
twist | number | 0.05 | Rotation added per layer, in radians. Higher values curl the arms more. |
lineWeight | number | 1 | How much each layer adds to the density. |
gamma | number | 1 | Contrast of the density. Higher values thin the swirl out. |
armContrast | number | 1 | How strongly the arms stand out from the lanes between them. |
softness | number | 0.5 | Softness of the arm edges. |
brightness | number | 1 | Exposure of the light. |
bloom | number | 0.6 | Soft glow around the brightest light. |
glowStrength | number | 0.05 | Extra light at the centre. |
glowRadius | number | 0.05 | Radius of the centre light. |
vignetteStart | number | 0 | Distance where the outer fade begins. |
vignetteEnd | number | 0.47 | Distance where the swirl has faded out. |
opacity | number | 1 | Overall opacity of the effect. |
interactive | boolean | true | Drag to spin the swirl. It keeps turning after release, then eases back to its idle speed. A click gives it a small push. |
spinStrength | number | 1 | How strongly drags and clicks spin the swirl. |
friction | number | 1 | How quickly a spin settles back to the idle speed. |
windup | number | 1 | How far the arms wind and unwind while the swirl spins fast. |
intro | boolean | true | Fades the light in while the swirl spins up. |
paused | boolean | false | Stops the motion. Reduced-motion users get a still frame. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
width | string | number | "100%" | Width of the component. |
height | string | number | "100%" | Height of the component. |
ref | { spin, replay } | - | spin(strength?) gives the swirl a push. replay() restarts the intro. |
children | ReactNode | - | Content layered above the swirl. |
className | string | - | Classes for the root element. |
style | CSSProperties | - | Inline styles for the root element. |
swirlColorstringMain colour of the swirl and its arms.
"#5227FF"glowColorstringColour the brightest arms and the core heat toward. Auto derives a lighter tone from the swirl colour.
"auto"backgroundColorstringFill behind the swirl. Transparent reads the page behind it. Light colours switch to an ink rendering.
"transparent"armsnumberNumber of spiral arms, from 3 to 8.
4speednumberSpeed of the idle turn.
1directionnumberTurn direction. 1 is clockwise, -1 is counter-clockwise.
1zoomnumberZoom into the swirl. Higher values make it smaller.
0.32layersnumberHow far the stacked layers reach, up to 30.
20layerStepnumberSpacing between layers. Smaller steps give a denser swirl.
0.13twistnumberRotation added per layer, in radians. Higher values curl the arms more.
0.05lineWeightnumberHow much each layer adds to the density.
1gammanumberContrast of the density. Higher values thin the swirl out.
1armContrastnumberHow strongly the arms stand out from the lanes between them.
1softnessnumberSoftness of the arm edges.
0.5brightnessnumberExposure of the light.
1bloomnumberSoft glow around the brightest light.
0.6glowStrengthnumberExtra light at the centre.
0.05glowRadiusnumberRadius of the centre light.
0.05vignetteStartnumberDistance where the outer fade begins.
0vignetteEndnumberDistance where the swirl has faded out.
0.47opacitynumberOverall opacity of the effect.
1interactivebooleanDrag to spin the swirl. It keeps turning after release, then eases back to its idle speed. A click gives it a small push.
truespinStrengthnumberHow strongly drags and clicks spin the swirl.
1frictionnumberHow quickly a spin settles back to the idle speed.
1windupnumberHow far the arms wind and unwind while the swirl spins fast.
1introbooleanFades the light in while the swirl spins up.
truepausedbooleanStops the motion. Reduced-motion users get a still frame.
falsedprnumberMaximum device pixel ratio for the canvas.
2widthstring | numberWidth of the component.
"100%"heightstring | numberHeight of the component.
"100%"ref{ spin, replay }spin(strength?) gives the swirl a push. replay() restarts the intro.
-childrenReactNodeContent layered above the swirl.
-classNamestringClasses for the root element.
-styleCSSPropertiesInline styles for the root element.
-