Mesh Gradient

Installation

npm i @paper-design/shaders-react

Code

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

<MeshGradient
  style={{ height: 500 }}
  distortion={0.8}
  swirl={0.1}
  offsetX={0}
  offsetY={0}
  scale={1}
  rotation={0}
  speed={1}
  colors={["#cc3333","#cc9933","#99cc33","#33cc33"]}
/>

Props

NameDescriptionTypeValues
colorsUp to 10 color spotsstring[]Hex, RGB, or HSL color
distortionThe power of organic noise distortionnumber0 to 1
swirlThe power of vortex distortionnumber0 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
speedAnimation speednumber0 to 2

Description

A flowing interplay of color spots, moving along distinct trajectories and transformed by organic distortion