Spiral
Installation
npm i @paper-design/shaders-react
Code
import { Spiral } from '@paper-design/shaders-react'; <Spiral height={500} colorBack="#001429" colorFront="#7ad1ff" density={1} distortion={0} strokeWidth={0.5} strokeTaper={0} strokeCap={0} noise={0} noiseFrequency={0} softness={0} offsetX={0} offsetY={0} scale={1} rotation={0} speed={1} />
Props
Name | Description | Type | Values |
---|---|---|---|
colorBack | Background color | string | Hex, RGB, or HSL color |
colorFront | The color of spiral shape | string | Hex, RGB, or HSL color |
density | Spacing falloff simulating perspective (0 = flat spiral) | number | 0 to 1 |
distortion | Power of shape distortion applied along the spiral | number | 0 to 1 |
strokeWidth | Thickness of spiral curve | number | 0 to 1 |
strokeTaper | how much the stroke is loosing width away from center (0 = full visibility) | number | 0 to 1 |
strokeCap | Extra stroke width at the center (not effective with strokeWidth = 0.5) | number | 0 to 1 |
noise | Noise distortion applied over the canvas (not effective with noiseFrequency = 0) | number | 0 to 1 |
noiseFrequency | Moise frequency (not effective with noise = 0) | number | 0 to 1 |
softness | Color transition sharpness (0 = hard edge, 1 = smooth gradient) | number | 0 to 1 |
offsetX | Horizontal offset of the spiral center | number | -1 to 1 |
offsetY | Vertical offset of the spiral center | number | -1 to 1 |
width | CSS width style of the shader element | number | string | — |
height | CSS height style of the shader element | number | string | — |
scale | Overall zoom level of the graphics | number | 0.01 to 4 |
rotation | Overall rotation angle of the graphics | number | 0 to 360 |
speed | Animation speed | number | 0 to 2 |
Description
A single-colored animated spiral that morphs across a wide range of shapes - from crisp, thin-lined geometry to flowing whirlpool forms and wavy, abstract rings.