Background & Ambient
The 10 effects B01–B10: purpose, API, options, examples, reduced motion and cost.
Experimental and not on npm
Ambient effects are pure decoration: their layers are aria-hidden, ignore the pointer and never contain content. They move only while on screen, on a visible page, without reduced motion and while the page switch allows it. Motion stops after duration (5 s by default); Infinity is explicit and must come with <AmbientMotionToggle> or ambientMotion.pause() (WCAG 2.2.2). Check text contrast against the brightest part of the decoration.
B01 · Gradient shift
<GradientShift> slides an oversized gradient of two to six colors behind its children; angle and speed (the length of a cycle in ms) set the movement.
- Import
@neshel-ui/animations/ambient- API
GradientShift, createGradientShift- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { GradientShift } from "@neshel-ui/animations/ambient";
export default function B01Example() {
return (
<GradientShift
colors={["#193767", "#4c1d95", "#7c2d12"]}
className="rounded-xl p-12 text-white"
>
Content stays above the decoration
</GradientShift>
);
}Options: GradientShiftOptions
GradientShiftOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| angle | number | 120 | Degrees (default 120). |
| colors | readonly string[] | — | — |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| reducedMotion | ReducedMotion | — | — |
| speed | number | — | One cycle in ms (4000–60000, default 14000). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B02 · Aurora
<Aurora> drifts two to five soft blobs with intensity (0.6). They are radial gradients, not blurred elements, so they stay inexpensive on large areas.
- Import
@neshel-ui/animations/ambient- API
Aurora, createAurora- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { Aurora } from "@neshel-ui/animations/ambient";
export default function B02Example() {
return (
<Aurora blobs={3} intensity={0.6} className="rounded-xl bg-[#0b1020] p-12 text-white">
Soft gradients, no blur filter
</Aurora>
);
}Options: AuroraOptions
AuroraOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| blobs | number | 3 | 2–5 (default 3). |
| colors | readonly string[] | — | — |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| intensity | number | 0.6 | Layer opacity 0–1 (default 0.6). |
| reducedMotion | ReducedMotion | — | — |
| speed | number | — | One cycle in ms (8000–60000, default 18000). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B03 · Grain
<Grain> overlays one shared noise texture with opacity (0.08, up to 0.3), scale and blend. jitter moves it in steps at 8 Hz at most and is off by default.
- Import
@neshel-ui/animations/ambient- API
Grain, createGrain- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { Grain } from "@neshel-ui/animations/ambient";
export default function B03Example() {
return (
<Grain opacity={0.12} className="rounded-xl bg-neshel-muted p-12 text-neshel-foreground">
One static texture, optional stepped jitter
</Grain>
);
}Options: GrainOptions
GrainOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| blend | "normal" | "overlay" | "soft-light" | "multiply" | "screen" | overlay | mix-blend-mode (default overlay). |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| jitter | boolean | — | Stepped texture shift at ≤ 8 Hz (default false: static grain). |
| opacity | number | 0.08 | 0–0.3 (default 0.08). |
| reducedMotion | ReducedMotion | — | — |
| scale | number | 1 | Texture scale 0.5–4 (default 1). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B04 · Particles
<Particles> draws seeded particles whose number follows the area (density) up to max (120, never more than 400); links connects neighbours with at most 150 particles. Under reduced motion it draws one still frame. Put padding on an inner element: padding on the container itself stretches the drawing.
- Import
@neshel-ui/animations/ambient- API
Particles, createParticles- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- Draws on a decorative Canvas 2D surface with a capped pixel ratio; the surface is released when it is not needed.
"use client";
import "@neshel-ui/animations/ambient.css";
import { Particles } from "@neshel-ui/animations/ambient";
export default function B04Example() {
return (
<Particles
density={14}
links
seed={7}
color="#cbd5ff"
className="rounded-xl bg-[#0b1020] text-white"
>
<div className="p-12">Seeded, capped and paused off screen</div>
</Particles>
);
}Options: ParticlesOptions
ParticlesOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | — | CSS colour (default: the container's text colour). |
| density | number | — | Particles per 100 000 px² (0–40, default 8). |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| fps | number | — | Frame-rate cap 15–60 (default 60; 30 in low-power mode). |
| linkDistance | number | — | Link distance in px (20–200, default 110). |
| links | boolean | — | Lines between near particles (only with ≤ 150 particles; default false). |
| lowPower | "auto" | boolean | — | auto (default) detects limited devices; true/false force it. |
| max | number | — | Upper bound (1–400, default 120). |
| maxDpr | number | 2 | DPR cap 1–3 (default 2). |
| reducedMotion | ReducedMotion | — | — |
| seed | number | 7 | PRNG seed (default 7). |
| size | number | — | Radius in px (0.5–6, default 1.6). |
| speed | number | — | px per second (0–120, default 18). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B05 · Starfield
<Starfield> draws depth layers of stars that drift or travel towards the viewer (mode "drift" or "warp"), with twinkle and speed. Prefer drift: warp fills the field of view. As with particles, put padding on an inner element.
- Import
@neshel-ui/animations/ambient- API
Starfield, createStarfield- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- Draws on a decorative Canvas 2D surface with a capped pixel ratio; the surface is released when it is not needed.
"use client";
import "@neshel-ui/animations/ambient.css";
import { Starfield } from "@neshel-ui/animations/ambient";
export default function B05Example() {
return (
<Starfield mode="drift" twinkle={0.4} className="rounded-xl bg-[#020617] text-white">
<div className="p-12">Depth layers on one canvas</div>
</Starfield>
);
}Options: StarfieldOptions
StarfieldOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | — | CSS colour (default: the container's text colour). |
| density | number | — | Stars per 100 000 px² (0–80, default 20). |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| fps | number | — | Frame-rate cap 15–60 (default 60; 30 in low-power mode). |
| lowPower | "auto" | boolean | — | auto (default) detects limited devices; true/false force it. |
| max | number | — | Upper bound (1–800, default 360). |
| maxDpr | number | 2 | DPR cap 1–3 (default 2). |
| mode | "drift" | "warp" | — | drift (default, sideways parallax) or warp (stars fly outward; more vestibular). |
| reducedMotion | ReducedMotion | — | — |
| seed | number | 7 | PRNG seed (default 7). |
| speed | number | 0.25 | 0–1 (default 0.25). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
| twinkle | number | — | Twinkle amplitude 0–1 (default 0.3; ≤ 1 Hz per star, no flashing). |
B06 · Grid and dots
<GridPattern> loops a grid or dots pattern by exactly one cell, so it is seamless; direction, speed and fade adjust it.
- Import
@neshel-ui/animations/ambient- API
GridPattern, createGridPattern- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { GridPattern } from "@neshel-ui/animations/ambient";
export default function B06Example() {
return (
<GridPattern
pattern="dots"
cell={24}
className="rounded-xl bg-neshel-surface p-12 text-neshel-surface-foreground"
>
A seamless one-cell loop
</GridPattern>
);
}Options: GridPatternOptions
GridPatternOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| cell | number | — | Cell in px (8–160, default 32). |
| color | string | — | — |
| direction | "diagonal" | "up" | "down" | "left" | "right" | — | — |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| fade | boolean | true | Radial fade toward the edges (default true). |
| lineWidth | number | — | Line width / dot radius in px (0.5–4, default 1). |
| pattern | "grid" | "dots" | — | — |
| reducedMotion | ReducedMotion | — | — |
| speed | number | — | Cells per second (0–2, default 0.15). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B07 · Mesh gradient
<MeshGradient> moves radial colour points over a base: three to six colors, amplitude (0.12) and speed. It is made with CSS layers, without WebGL.
- Import
@neshel-ui/animations/ambient- API
MeshGradient, createMeshGradient- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { MeshGradient } from "@neshel-ui/animations/ambient";
export default function B07Example() {
return (
<MeshGradient
colors={["#0f172a", "#1e3a8a", "#4c1d95", "#134e4a"]}
className="rounded-xl p-12 text-white"
>
Radial points on a base colour
</MeshGradient>
);
}Options: MeshGradientOptions
MeshGradientOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| amplitude | number | — | Point travel as a fraction of the box (0–0.3, default 0.12). |
| colors | readonly string[] | — | Base colour then 2–5 point colours (default a 4-point palette). |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| reducedMotion | ReducedMotion | — | — |
| speed | number | — | One cycle in ms (10000–90000, default 24000). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B08 · Floating shapes
<FloatingShapes> makes each of its children (at most 24) float by amplitude pixels and rotate degrees with a period. The children are the decoration, so keep real content elsewhere.
- Import
@neshel-ui/animations/ambient- API
FloatingShapes, createFloatingShapes- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
"use client";
import "@neshel-ui/animations/ambient.css";
import { FloatingShapes } from "@neshel-ui/animations/ambient";
export default function B08Example() {
return (
<FloatingShapes
amplitude={16}
rotate={8}
className="flex gap-6 rounded-xl bg-neshel-muted p-12"
>
<div className="size-12 rounded-lg bg-neshel-primary" />
<div className="size-12 rounded-full bg-neshel-accent" />
</FloatingShapes>
);
}Options: FloatingShapesOptions
FloatingShapesOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| amplitude | number | — | px (0–40, default 12). |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| max | number | — | Children moved at most (1–24, default 24). |
| period | number | — | One float cycle in ms (2000–30000, default 7000). |
| reducedMotion | ReducedMotion | — | — |
| rotate | number | — | Degrees (0–30, default 6). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B09 · Pointer glow
<PointerGlow> follows the pointer with a soft light: size (360 px), color, intensity and smoothing. It works only with the configured pointerTypes and stays still under reduced motion.
- Import
@neshel-ui/animations/ambient- API
PointerGlow, createPointerGlow- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
"use client";
import "@neshel-ui/animations/ambient.css";
import { PointerGlow } from "@neshel-ui/animations/ambient";
export default function B09Example() {
return (
<PointerGlow
size={260}
intensity={0.5}
color="#38bdf8"
className="rounded-xl bg-[#0b1020] p-12 text-white"
>
Move the pointer here
</PointerGlow>
);
}Options: PointerGlowOptions
PointerGlowOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | — | — |
| intensity | number | 0.35 | 0–1 (default 0.35). |
| pointerTypes | readonly ("mouse" | "pen" | "touch")[] | — | — |
| reducedMotion | ReducedMotion | — | — |
| size | number | — | Glow diameter in px (80–1200, default 360). |
| smoothing | number | — | 0 (snappy) – 0.95 (floaty), default 0.2. |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
B10 · Waves
<Waves> loops one to four SVG wave layers with amplitude, wavelength and colors at the top or the bottom (position). The paths are generated once. The example includes the page switch.
- Import
@neshel-ui/animations/ambient- API
Waves, createWaves- Stylesheet
@neshel-ui/animations/ambient.css- Reduced motion
static— the decoration or content stays still- Performance
- The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
"use client";
import "@neshel-ui/animations/ambient.css";
import { AmbientMotionToggle, Waves } from "@neshel-ui/animations/ambient";
export default function B10Example() {
return (
<div className="grid justify-items-start gap-3">
<Waves
layers={3}
amplitude={18}
colors={["#1e3a8a", "#1d4ed8", "#0369a1"]}
className="h-48 w-full rounded-xl bg-[#0b1020] p-8 text-white"
>
Waves at the bottom edge
</Waves>
<AmbientMotionToggle />
</div>
);
}Options: WavesOptions
WavesOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| amplitude | number | — | px (4–80, default 18). |
| colors | readonly string[] | — | — |
| duration | number | — | ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>). |
| layers | number | 3 | 1–4 (default 3). |
| position | "bottom" | "top" | — | — |
| reducedMotion | ReducedMotion | — | — |
| speed | number | — | One wavelength travel in ms (4000–60000, default 12000). |
| trigger | "mount" | "manual" | — | mount (default) starts at once; manual waits for play(). |
| wavelength | number | — | px (80–1600, default 600). |