Skip to Content
Neshel-UI
Animations (experimental)Effects

Background & Ambient

The 10 effects B01–B10: purpose, API, options, examples, reduced motion and cost.

Experimental and not on npm

@neshel-ui/animations is a private package (0.0.0). It cannot be installed, and its API may change before a first publication. These pages document what exists in the repository.

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.
Preview: B01
Preview theme: B01
Content stays above the decoration
b01.tsx
"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

GradientShiftOptions
PropTypeDefaultDescription
anglenumber120Degrees (default 120).
colorsreadonly string[]——
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
reducedMotionReducedMotion——
speednumber—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.
Preview: B02
Preview theme: B02
Soft gradients, no blur filter
b02.tsx
"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

AuroraOptions
PropTypeDefaultDescription
blobsnumber32–5 (default 3).
colorsreadonly string[]——
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
intensitynumber0.6Layer opacity 0–1 (default 0.6).
reducedMotionReducedMotion——
speednumber—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.
Preview: B03
Preview theme: B03
One static texture, optional stepped jitter
b03.tsx
"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

GrainOptions
PropTypeDefaultDescription
blend"normal" | "overlay" | "soft-light" | "multiply" | "screen"overlaymix-blend-mode (default overlay).
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
jitterboolean—Stepped texture shift at ≤ 8 Hz (default false: static grain).
opacitynumber0.080–0.3 (default 0.08).
reducedMotionReducedMotion——
scalenumber1Texture 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.
Preview: B04
Preview theme: B04
Seeded, capped and paused off screen
b04.tsx
"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

ParticlesOptions
PropTypeDefaultDescription
colorstring—CSS colour (default: the container's text colour).
densitynumber—Particles per 100 000 px² (0–40, default 8).
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
fpsnumber—Frame-rate cap 15–60 (default 60; 30 in low-power mode).
linkDistancenumber—Link distance in px (20–200, default 110).
linksboolean—Lines between near particles (only with ≤ 150 particles; default false).
lowPower"auto" | boolean—auto (default) detects limited devices; true/false force it.
maxnumber—Upper bound (1–400, default 120).
maxDprnumber2DPR cap 1–3 (default 2).
reducedMotionReducedMotion——
seednumber7PRNG seed (default 7).
sizenumber—Radius in px (0.5–6, default 1.6).
speednumber—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.
Preview: B05
Preview theme: B05
Depth layers on one canvas
b05.tsx
"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

StarfieldOptions
PropTypeDefaultDescription
colorstring—CSS colour (default: the container's text colour).
densitynumber—Stars per 100 000 px² (0–80, default 20).
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
fpsnumber—Frame-rate cap 15–60 (default 60; 30 in low-power mode).
lowPower"auto" | boolean—auto (default) detects limited devices; true/false force it.
maxnumber—Upper bound (1–800, default 360).
maxDprnumber2DPR cap 1–3 (default 2).
mode"drift" | "warp"—drift (default, sideways parallax) or warp (stars fly outward; more vestibular).
reducedMotionReducedMotion——
seednumber7PRNG seed (default 7).
speednumber0.250–1 (default 0.25).
trigger"mount" | "manual"—mount (default) starts at once; manual waits for play().
twinklenumber—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.
Preview: B06
Preview theme: B06
A seamless one-cell loop
b06.tsx
"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

GridPatternOptions
PropTypeDefaultDescription
cellnumber—Cell in px (8–160, default 32).
colorstring——
direction"diagonal" | "up" | "down" | "left" | "right"——
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
fadebooleantrueRadial fade toward the edges (default true).
lineWidthnumber—Line width / dot radius in px (0.5–4, default 1).
pattern"grid" | "dots"——
reducedMotionReducedMotion——
speednumber—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.
Preview: B07
Preview theme: B07
Radial points on a base colour
b07.tsx
"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

MeshGradientOptions
PropTypeDefaultDescription
amplitudenumber—Point travel as a fraction of the box (0–0.3, default 0.12).
colorsreadonly string[]—Base colour then 2–5 point colours (default a 4-point palette).
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
reducedMotionReducedMotion——
speednumber—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.
Preview: B08
Preview theme: B08
b08.tsx
"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

FloatingShapesOptions
PropTypeDefaultDescription
amplitudenumber—px (0–40, default 12).
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
maxnumber—Children moved at most (1–24, default 24).
periodnumber—One float cycle in ms (2000–30000, default 7000).
reducedMotionReducedMotion——
rotatenumber—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.
Preview: B09
Preview theme: B09
Move the pointer here
b09.tsx
"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

PointerGlowOptions
PropTypeDefaultDescription
colorstring——
intensitynumber0.350–1 (default 0.35).
pointerTypesreadonly ("mouse" | "pen" | "touch")[]——
reducedMotionReducedMotion——
sizenumber—Glow diameter in px (80–1200, default 360).
smoothingnumber—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.
Preview: B10
Preview theme: B10
Waves at the bottom edge
b10.tsx
"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

WavesOptions
PropTypeDefaultDescription
amplitudenumber—px (4–80, default 18).
colorsreadonly string[]——
durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
layersnumber31–4 (default 3).
position"bottom" | "top"——
reducedMotionReducedMotion——
speednumber—One wavelength travel in ms (4000–60000, default 12000).
trigger"mount" | "manual"—mount (default) starts at once; manual waits for play().
wavelengthnumber—px (80–1600, default 600).
Edit on GitHub

On this page