Mesh Gradient Shader

Use Mesh Gradient Shader for a decorative background built from moving color spots, distortion, and vortex effects. It can provide subtle ambient motion or remain static behind content.

Preview

Reduce motion:Off
Tune:Off
Inspect

Installation

Basic usage

TypeScript
mesh-background.tsx

Examples

Adjust colors, distortion, swirl, and grain to fit the surface. Set speed to zero when the background should remain still.

Usage

API

PropertyTypeDefaultDescription
colorsstring[]["#ff6b6b", "#4ecdc4", "#45b7d1", "#96ceb4", "#ffeaa7"]Up to 10 color spots. Accepts hex, RGB, or HSL strings.
distortionnumber0.3Power of organic noise distortion (0–1).
swirlnumber0.2Power of vortex distortion (0–1).
grainMixernumber0Grain distortion on color edges (0–1).
grainOverlaynumber0Post-processing grain overlay (0–1).
speednumber1Animation speed multiplier. 0 = static.

Accessibility

Treat the shader as decorative. Check text contrast against the final color field and provide a reduced-motion alternative for meaningful content.

Styling

Use className to constrain the shader to its background layer. The color controls accept standard CSS color values.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.