Liquid Smoke, animated React component
A fluid you stir with the pointer, solved on the GPU. Move and smoke pours out of the cursor, curls into eddies and fades, lit so it reads as a body of smoke with a wet glint on its folds. A slow drift leaves a wisp and a fast sweep pours. Screen it over a dark section or set Multiply for ink on a light one, inside any element or over the whole page. Clicks pass straight through. It sleeps once the trail has gone, skips machines without a GPU, and stays off for people who ask for reduced motion.
- Pro
- Background Effects
- Hover
Play with it
Move over the stage to stir it. Multiply turns the stage light and draws in ink.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| area | "inside" | "page" | "inside" | inside fills its parent and listens to the pointer there (give the parent position: relative). page is a fixed layer over the whole window. |
| color | string | "#e9e9ee" | Colour of the smoke. Ignored when rainbow is on. With blend set to multiply and no colour given, it draws in near-black. |
| rainbow | boolean | false | Shifts the hue by itself as you move. |
| blend | "normal" | "screen" | "multiply" | "difference" | "screen" | How the smoke sits on what is behind it. screen for dark backgrounds, multiply for ink on light ones. |
| cursor | "native" | "dot" | "ring" | "ring" | The pointer over the area. native keeps the system cursor. |
| fade | number | 2.4 | How fast the trail fades. Higher is shorter. |
| force | number | 6000 | How hard the pointer pushes the fluid. |
| radius | number | 0.25 | Size of each puff. |
| swirl | number | 14 | How much it curls into eddies. 0 flows smooth. |
| shading | boolean | true | Lights the surface so it reads as a body of smoke. |
| gloss | number | 0.5 | The wet glint on the shaded surface, 0 to 1. |
| cursorColor | string | — | Colour of the ring or dot. White on dark blends and near-black in ink mode when left out. |
| autoplay | boolean | false | Stirs itself along a slow path until a pointer moves over it, and again after it leaves. Off under reduced motion. |
| pixelRatio | number | 1.5 | Highest device pixel ratio the canvas draws at. Lower is lighter on the GPU. |
| allowSoftware | boolean | false | Also run where WebGL is drawn in software (no GPU). Slow, so it is off and the area stays empty there. |
| className | string | — | Classes for the layer that holds the canvas. |
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
Liquid Smoke 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