Shader Flow, animated React component
A real WebGL fragment shader of domain-warped noise that drifts like ink in water, with a static gradient fallback where WebGL is missing. Move the pointer and the flow swirls behind it on a lagging spring; stop and the swirl swings into a small counter-twist before it calms.
- Pro
- Background Effects
- Hover
- Spring
- Glow
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| children | ReactNode | — | Content over the flow. Replaces the default title card. |
| className | string | — | Extra classes on the panel (size, radius). |
| showContent | boolean | true | Show the default title card when no children are passed. |
| cursorReactive | boolean | true | Let the pointer stir the flow. |
| intensity | "low" | "medium" | "high" | "medium" | Strength of the colour and warping. |
| colors | [string, string, string, string] | ["#05060d", "#1d39d6", "#bf5af2", "#ff9f6a"] | Four hex colours: base, body, accent, highlight. |
| speed | number | 1 | Speed multiplier for the drift. |
| autoplay | boolean | false | Stirs the flow with a pretend pointer until someone moves over it. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Shader Flow is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Shader Flow works
A real fragment shader: domain-warped noise that drifts like ink in water. and the swirl springs past zero into a small counter-twist before it calms. Falls back to a static gradient where WebGL is unavailable.
The source, the install command and the build prompt come with Pro.
About Shader Flow
Shader Flow renders a soft animated background with flowing gradient motion that simulates a GLSL shader aesthetic using pure CSS. Gradient blobs shift position, opacity, and hue over time with CSS keyframe animation, blending into an organic, fluid movement pattern. No WebGL or canvas API — the shader-like appearance is achieved entirely with CSS gradients and animation. Works as a full-viewport background or a contained section fill.
Good for
- Hero and landing page backgrounds
- Card and panel gradient fills
- Atmospheric section dividers
- Creative and design tool landing pages
Shader Flow questions
How do I install Shader Flow?
Run `npx shadcn@latest add @nexus-labs/shader-flow`. It installs framer-motion.
Is it a real WebGL shader?
No. It is shader-style: large blurred gradient blobs animated with Framer Motion plus a light noise overlay. There is no canvas or WebGL, so it runs anywhere CSS blur works.
Which props does it take?
`children` replaces the sample content, and `showContent={false}` hides it. `cursorReactive` (on by default) makes the blobs shift with the mouse, and `intensity` ("low", "medium", "high") scales that movement.
What happens with reduced motion?
With prefers-reduced-motion on, the moving blobs are replaced by a static gradient.