Static Radial Gradient
Installation
npm i @paper-design/shaders-react
Code
import { StaticRadialGradient } from '@paper-design/shaders-react';
<StaticRadialGradient
height={500}
colors={["#cc3333", "#cc9933", "#99cc33"]}
colorBack="#000000"
radius={0.8}
focalDistance={0.99}
focalAngle={0}
falloff={0.24}
mixing={0.35}
distortion={0}
distortionShift={0}
distortionFreq={12}
grainMixer={0}
grainOverlay={0}
offsetX={0}
offsetY={0}
/>
Props
| Name | Description | Type | Values |
|---|---|---|---|
| colors | Up to 10 colors used in the gradient | string[] | Hex, RGB, or HSL color |
| colorBack | Background color | string | Hex, RGB, or HSL color |
| radius | The size of the shape | number | 0 to 3 |
| focalDistance | Distance of the focal point from center | number | 0 to 3 |
| falloff | Gradient decay (0 for linear gradient) | number | -1 to 1 |
| focalAngle | Angle of the focal point in degrees (effective with focalDistance > 0) | number | 0 to 360 |
| mixing | Blending behavior (sharper vs. smoother color transitions) | number | 0 to 1 |
| distortion | Strength of radial distortion | number | 0 to 1 |
| distortionShift | Radial distortion offset (effective with distortion > 0) | number | -1 to 1 |
| distortionFreq | Radial distortion frequency (effective with distortion > 0) | number | 0 to 20 (integer) |
| grainMixer | Strength of grain distortion applied to color edges | number | 0 to 1 |
| grainOverlay | Post-processing RGB grain overlay | 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 | — |
Description
Radial gradient with up to 10 blended colors, featuring advanced focal point control, shape distortion, and grain effects.