Static Mesh Gradient

Installation

npm i @paper-design/shaders-react

Code

import { StaticMeshGradient } from '@paper-design/shaders-react';

<StaticMeshGradient
  style={{ height: 500 }}
  positions={2}
  waveX={1}
  waveXShift={0.6}
  waveY={1}
  waveYShift={0.21}
  mixing={0.93}
  grainMixer={0}
  grainOverlay={0}
  offsetX={0}
  offsetY={0}
  scale={1}
  rotation={270}
  colors={["#cc3333","#cc9933","#99cc33","#33cc33"]}
/>

Props

NameDescriptionTypeValues
colorsUp to 10 colors used in the gradientstring[]Hex, RGB, or HSL color
positionsColor spots placementnumber0 to 100
waveXStrength of sine wave distortion along X axisnumber0 to 1
waveXShiftPhase offset applied to the X-axis wavenumber0 to 1
waveYStrength of sine wave distortion along Y axisnumber0 to 1
waveYShiftPhase offset applied to the Y-axis wavenumber0 to 1
mixingBlending behavior (sharper vs. smoother color transitions)number0 to 1
grainMixerStrength of grain distortion applied to color edgesnumber0 to 1
grainOverlayPost-processing RGB grain overlaynumber0 to 1
offsetXHorizontal offset of the graphics centernumber-1 to 1
offsetYVertical offset of the graphics centernumber-1 to 1
scaleOverall zoom level of the graphicsnumber0.01 to 4
rotationOverall rotation angle of the graphicsnumber0 to 360

Description

Multi-point mesh gradients with up to 10 color spots, enhanced by two-direction warping, adjustable blend sharpness, and grain controls. Perfect for elegant wallpapers and atmospheric backdrops