Swirl
Installation
npm i @paper-design/shaders-react
Code
import { Swirl } from '@paper-design/shaders-react'; <Swirl style={{ height: 500 }} colorBack="#330000" bandCount={4} twist={0.1} softness={0} noiseFrequency={0.32} noise={0.32} offsetX={0} offsetY={0} scale={1} rotation={0} speed={0.32} colors={["#cc3333","#cc9933","#99cc33"]} />
Props
Name | Description | Type | Values |
---|---|---|---|
colorBack | Background color | string | Hex, RGB, or HSL color |
colors | Up to 10 colors used for the stripes | 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 |
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 |
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