Shader Background

Animated backdrop for hero sections and empty states.

@paneui/theme@paper-design/shaders-reactmotion

Your week, handled

Colours come from your theme tokens, so it follows light and dark.

MeshGrainWarpWavesOrbit

Installation

pnpm dlx shadcn@latest add @paneui/shader-background

Usage

Examples

Custom Colors

Use to match a brand palette instead of the theme.

Speed and Paused

Shader Props

Use to tune a shader beyond the built-in props.

Motion

The animation stops under reduced motion and whenever the element is off screen. waves is a static pattern and ignores speed.

API Reference

ShaderBackground

A WebGL shader layer behind its children, coloured from your theme tokens by default. Also accepts every prop of div.

variant= "mesh-gradient"
"mesh-gradient" | "grain-gradient" | "warp" | "waves" | "dot-orbit"
Which shader to render.
colors
string[]
Any CSS colours, including var(--token) and color-mix(...), re-read when the theme changes. Defaults to tints of --primary and --background; waves uses only the first colour.
colorBack= "var(--background)"
string
Base colour behind the pattern (grain, waves, dot orbit).
speed= 0.6
number
Animation speed. 0 freezes the current frame.
paused= false
boolean
Freeze the animation.
shaderProps
Partial<MeshGradientProps | GrainGradientProps | WarpProps | WavesProps | DotOrbitProps>
Extra props for the chosen shader, matched to variant. speed is always controlled by the component.
shaderClassName
string
Class for the shader layer (e.g. opacity or blend mode).
PropTypeDefaultDescription
variant"mesh-gradient" | "grain-gradient" | "warp" | "waves" | "dot-orbit""mesh-gradient"Which shader to render.
colorsstring[]—Any CSS colours, including var(--token) and color-mix(...), re-read when the theme changes. Defaults to tints of --primary and --background; waves uses only the first colour.
colorBackstring"var(--background)"Base colour behind the pattern (grain, waves, dot orbit).
speednumber0.6Animation speed. 0 freezes the current frame.
pausedbooleanfalseFreeze the animation.
shaderPropsPartial<MeshGradientProps | GrainGradientProps | WarpProps | WavesProps | DotOrbitProps>—Extra props for the chosen shader, matched to variant. speed is always controlled by the component.
shaderClassNamestring—Class for the shader layer (e.g. opacity or blend mode).
data-variant
The active variant.
data-paused
Present while the animation is frozen (paused, off screen or reduced motion).
Data attributeDescription
data-variantThe active variant.
data-pausedPresent while the animation is frozen (paused, off screen or reduced motion).