Swirl
Installation
npm i @paper-design/shaders-react
Code
import { Swirl } from '@paper-design/shaders-react'; <Swirl height={500} colors={["#cc3333", "#cc9933", "#99cc33"]} colorBack="#330000" bandCount={4} twist={0.1} center={0.2} proportion={0.5} softness={0} noise={0.2} noiseFrequency={0.4} offsetX={0} offsetY={0} scale={1} rotation={0} speed={0.32} />
Props
Name | Description | Type | Values |
---|---|---|---|
colors | Up to 10 colors used for the stripes | string[] | Hex, RGB, or HSL color |
colorBack | Background color | string | Hex, RGB, or HSL color |
bandCount | Number of color bands (0 for concentric ripples) | number | 0 to 15 (integer) |
twist | Vortex power (0 = straight sectoral shapes) | number | 0 to 1 |
center | How far from the center the swirl colors begin to appear | number | 0 to 1 |
proportion | Blend point between colors (0.5 = equal distribution) | number | 0 to 1 |
softness | Color transition sharpness (0 = hard edge, 1 = smooth gradient) | number | 0 to 1 |
noise | Strength of noise distortion (not effective with noiseFrequency = 0) | number | 0 to 1 |
noiseFrequency | Noise frequency (not effective with noise = 0) | number | 0 to 1 |
offsetX | Horizontal offset of the graphics center | number | -1 to 1 |
offsetY | Vertical offset of the graphics 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
Animated bands of color twisting and bending, producing spirals, arcs, and flowing circular patterns.