Skip to Content
Neshel-UI
Animations (experimental)Reference

@neshel-ui/animations/ambient

Every export of @neshel-ui/animations/ambient, generated from its declarations.

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.

Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.

  • AmbientMotionToggle component

    The page-level pause control for ambient motion (WCAG 2.2.2): a native toggle button.

    ({ label, className, ...rest }: AmbientMotionToggleProps): Element
  • Aurora component

    B02 — aurora blobs behind the children.

    (props: AuroraProps): Element
  • FloatingShapes component

    B08 — the children are the shapes (mark purely visual shapes `aria-hidden`).

    (props: FloatingShapesProps): Element
  • GradientShift component

    B01 — gradient shift behind the children.

    (props: GradientShiftProps): Element
  • Grain component

    B03 — grain overlay (static texture by default).

    (props: GrainProps): Element
  • GridPattern component

    B06 — drifting grid or dots.

    (props: GridPatternProps): Element
  • MeshGradient component

    B07 — mesh gradient.

    (props: MeshGradientProps): Element
  • Particles component

    B04 — particle field on a decorative canvas.

    (props: ParticlesProps): Element
  • PointerGlow component

    B09 — glow following the pointer behind the children.

    (props: PointerGlowProps): Element
  • Starfield component

    B05 — starfield on a decorative canvas.

    (props: StarfieldProps): Element
  • Waves component

    B10 — layered SVG waves.

    (props: WavesProps): Element
  • createAurora function

    B02 — soft radial blobs drifting (no blur filter).

    (container: HTMLElement, options?: AuroraOptions | undefined): AmbientControl
  • createFloatingShapes function

    B08 — the container's children bob and sway gently out of phase.

    (container: HTMLElement, options?: FloatingShapesOptions | undefined): AmbientControl
  • createGradientShift function

    B01 — a slowly shifting multi-stop gradient (oversized plane, compositor `transform` keyframes).

    (container: HTMLElement, options?: GradientShiftOptions | undefined): AmbientControl
  • createGrain function

    B03 — film grain from one shared static texture (no noise generated per frame).

    (container: HTMLElement, options?: GrainOptions | undefined): AmbientControl
  • createGridPattern function

    B06 — a grid or dot pattern drifting one cell per loop (seamless `transform`).

    (container: HTMLElement, options?: GridPatternOptions | undefined): AmbientControl
  • createMeshGradient function

    B07 — mesh-like gradient: large radial colour points over a base, drifting slowly (CSS, no GPU).

    (container: HTMLElement, options?: MeshGradientOptions | undefined): AmbientControl
  • createParticles function

    B04 — a seeded particle field drifting and wrapping, optionally linked.

    (container: HTMLElement, options?: ParticlesOptions | undefined): AmbientControl
  • createPointerGlow function

    B09 — a soft glow under the pointer inside the container (hidden at rest and under reduced motion).

    (container: HTMLElement, options?: PointerGlowOptions | undefined): AmbientControl
  • createStarfield function

    B05 — a seeded starfield with depth (drift parallax or warp), twinkling softly.

    (container: HTMLElement, options?: StarfieldOptions | undefined): AmbientControl
  • createWaves function

    B10 — layered SVG waves travelling one wavelength per loop (tiles generated once).

    (container: HTMLElement, options?: WavesOptions | undefined): AmbientControl
  • getAmbientDebugInfo function
    (): AmbientDebugInfo
  • waveTile function

    One wavelength of a sine wave as a filled SVG tile (cubic approximation, 4 segments).

    (wavelength: number, amplitude: number, height: number, color: string): string
  • ambientMotion const

    The page-level ambient switch (shared by every ambient effect and `<AmbientMotionToggle>`).

    AmbientMotionSwitch
  • AmbientControl interface

    AmbientControl

    AmbientControl
    PropTypeDefaultDescription
    blocked(required)readonly AmbientBlock[]—Why the decoration is not moving right now (empty while it moves).
    destroy(required)() => void——
    moving(required)boolean—Whether it is moving now.
    pause(required)() => void——
    play(required)() => void——
    state(required)AmbientState——
    stop(required)() => void—Stop and show the rest frame.
  • AmbientDebugInfo interface

    AmbientDebugInfo

    AmbientDebugInfo
    PropTypeDefaultDescription
    contexts(required)number——
    cssRunning(required)number——
    draws(required)number——
    effects(required)number——
    observers(required)number——
    surfaces(required)number——
    ticking(required)number——
    toggles(required)number——
    visibilityListeners(required)number——
  • AmbientMotionSwitch interface

    AmbientMotionSwitch

    AmbientMotionSwitch
    PropTypeDefaultDescription
    pause(required)() => void——
    paused(required)boolean—Whether the user paused ambient motion for the page.
    resume(required)() => void——
    subscribe(required)(listener: (paused: boolean) => void) => () => void——
    toggle(required)() => void——
  • AmbientOptions interface

    AmbientOptions

    AmbientOptions
    PropTypeDefaultDescription
    durationnumber—ms of motion before resting (100–600000, default 5000) or Infinity (explicit; offer <AmbientMotionToggle>).
    reducedMotionReducedMotion——
    trigger"mount" | "manual"—mount (default) starts at once; manual waits for play().
  • AuroraOptions interface

    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().
  • CanvasAmbientOptions interface

    CanvasAmbientOptions

    CanvasAmbientOptions
    PropTypeDefaultDescription
    colorstring—CSS colour (default: the container's text colour).
    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.
    maxDprnumber2DPR cap 1–3 (default 2).
    reducedMotionReducedMotion——
    seednumber7PRNG seed (default 7).
    trigger"mount" | "manual"—mount (default) starts at once; manual waits for play().
  • FloatingShapesOptions interface

    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().
  • GradientShiftOptions interface

    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().
  • GrainOptions interface

    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().
  • GridPatternOptions interface

    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().
  • MeshGradientOptions interface

    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().
  • ParticlesOptions interface

    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().
  • PointerGlowOptions interface

    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().
  • StarfieldOptions interface

    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).
  • WavesOptions interface

    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).
  • AmbientBlock type
    "offscreen" | "hidden" | "reduced" | "toggle" | "paused"
  • AmbientMotionToggleProps type

    AmbientMotionToggleProps

    AmbientMotionToggleProps
    PropTypeDefaultDescription
    labelstring"Pause background motion"Visible label (default "Pause background motion"); aria-pressed reports the paused state.

    Also accepts the props of: React DOM attributes.

  • AmbientState type
    "idle" | "running" | "paused" | "completed"
  • AuroraProps type

    AuroraProps

    AuroraProps
    PropTypeDefaultDescription
    blobsnumber32–5 (default 3).
    childrenReactNode——
    colorsreadonly string[]——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • FloatingShapesProps type

    FloatingShapesProps

    FloatingShapesProps
    PropTypeDefaultDescription
    amplitudenumber—px (0–40, default 12).
    childrenReactNode——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • GradientShiftProps type

    GradientShiftProps

    GradientShiftProps
    PropTypeDefaultDescription
    anglenumber120Degrees (default 120).
    childrenReactNode——
    colorsreadonly string[]——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • GrainProps type

    GrainProps

    GrainProps
    PropTypeDefaultDescription
    blend"normal" | "overlay" | "soft-light" | "multiply" | "screen"overlaymix-blend-mode (default overlay).
    childrenReactNode——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • GridPatternProps type

    GridPatternProps

    GridPatternProps
    PropTypeDefaultDescription
    cellnumber—Cell in px (8–160, default 32).
    childrenReactNode——
    colorstring——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • MeshGradientProps type

    MeshGradientProps

    MeshGradientProps
    PropTypeDefaultDescription
    amplitudenumber—Point travel as a fraction of the box (0–0.3, default 0.12).
    childrenReactNode——
    colorsreadonly string[]—Base colour then 2–5 point colours (default a 4-point palette).
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • ParticlesProps type

    ParticlesProps

    ParticlesProps
    PropTypeDefaultDescription
    childrenReactNode——
    colorstring—CSS colour (default: the container's text colour).
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • PointerGlowProps type

    PointerGlowProps

    PointerGlowProps
    PropTypeDefaultDescription
    childrenReactNode——
    colorstring——
    controlRefRefObject<AmbientControl | null>——
    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().

    Also accepts the props of: React DOM attributes.

  • StarfieldProps type

    StarfieldProps

    StarfieldProps
    PropTypeDefaultDescription
    childrenReactNode——
    colorstring—CSS colour (default: the container's text colour).
    controlRefRefObject<AmbientControl | null>——
    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).

    Also accepts the props of: React DOM attributes.

  • WavesProps type

    WavesProps

    WavesProps
    PropTypeDefaultDescription
    amplitudenumber—px (4–80, default 18).
    childrenReactNode——
    colorsreadonly string[]——
    controlRefRefObject<AmbientControl | null>——
    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).

    Also accepts the props of: React DOM attributes.

Edit on GitHub