@neshel-ui/animations/ambient
Every export of @neshel-ui/animations/ambient, generated from its declarations.
Experimental and not on npm
Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.
AmbientMotionTogglecomponentThe page-level pause control for ambient motion (WCAG 2.2.2): a native toggle button.
({ label, className, ...rest }: AmbientMotionToggleProps): ElementAuroracomponentB02 — aurora blobs behind the children.
(props: AuroraProps): ElementFloatingShapescomponentB08 — the children are the shapes (mark purely visual shapes `aria-hidden`).
(props: FloatingShapesProps): ElementGradientShiftcomponentB01 — gradient shift behind the children.
(props: GradientShiftProps): ElementGraincomponentB03 — grain overlay (static texture by default).
(props: GrainProps): ElementGridPatterncomponentB06 — drifting grid or dots.
(props: GridPatternProps): ElementMeshGradientcomponentB07 — mesh gradient.
(props: MeshGradientProps): ElementParticlescomponentB04 — particle field on a decorative canvas.
(props: ParticlesProps): ElementPointerGlowcomponentB09 — glow following the pointer behind the children.
(props: PointerGlowProps): ElementStarfieldcomponentB05 — starfield on a decorative canvas.
(props: StarfieldProps): ElementWavescomponentB10 — layered SVG waves.
(props: WavesProps): ElementcreateAurorafunctionB02 — soft radial blobs drifting (no blur filter).
(container: HTMLElement, options?: AuroraOptions | undefined): AmbientControlcreateFloatingShapesfunctionB08 — the container's children bob and sway gently out of phase.
(container: HTMLElement, options?: FloatingShapesOptions | undefined): AmbientControlcreateGradientShiftfunctionB01 — a slowly shifting multi-stop gradient (oversized plane, compositor `transform` keyframes).
(container: HTMLElement, options?: GradientShiftOptions | undefined): AmbientControlcreateGrainfunctionB03 — film grain from one shared static texture (no noise generated per frame).
(container: HTMLElement, options?: GrainOptions | undefined): AmbientControlcreateGridPatternfunctionB06 — a grid or dot pattern drifting one cell per loop (seamless `transform`).
(container: HTMLElement, options?: GridPatternOptions | undefined): AmbientControlcreateMeshGradientfunctionB07 — mesh-like gradient: large radial colour points over a base, drifting slowly (CSS, no GPU).
(container: HTMLElement, options?: MeshGradientOptions | undefined): AmbientControlcreateParticlesfunctionB04 — a seeded particle field drifting and wrapping, optionally linked.
(container: HTMLElement, options?: ParticlesOptions | undefined): AmbientControlcreatePointerGlowfunctionB09 — a soft glow under the pointer inside the container (hidden at rest and under reduced motion).
(container: HTMLElement, options?: PointerGlowOptions | undefined): AmbientControlcreateStarfieldfunctionB05 — a seeded starfield with depth (drift parallax or warp), twinkling softly.
(container: HTMLElement, options?: StarfieldOptions | undefined): AmbientControlcreateWavesfunctionB10 — layered SVG waves travelling one wavelength per loop (tiles generated once).
(container: HTMLElement, options?: WavesOptions | undefined): AmbientControlgetAmbientDebugInfofunction(): AmbientDebugInfowaveTilefunctionOne wavelength of a sine wave as a filled SVG tile (cubic approximation, 4 segments).
(wavelength: number, amplitude: number, height: number, color: string): stringambientMotionconstThe page-level ambient switch (shared by every ambient effect and `<AmbientMotionToggle>`).
AmbientMotionSwitchAmbientControlinterfaceAmbientControl
AmbientControl Prop Type Default Description 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. AmbientDebugInfointerfaceAmbientDebugInfo
AmbientDebugInfo Prop Type Default Description 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— — AmbientMotionSwitchinterfaceAmbientMotionSwitch
AmbientMotionSwitch Prop Type Default Description 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— — AmbientOptionsinterfaceAmbientOptions
AmbientOptions Prop Type Default Description duration number— ms of motion before resting (100–600000, default 5000) or Infinity(explicit; offer<AmbientMotionToggle>).reducedMotion ReducedMotion— — trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().AuroraOptionsinterfaceAuroraOptions
AuroraOptions Prop Type Default Description blobs number32–5 (default 3). colors readonly string[]— — duration number— ms of motion before resting (100–600000, default 5000) or Infinity(explicit; offer<AmbientMotionToggle>).intensity number0.6Layer 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;manualwaits forplay().CanvasAmbientOptionsinterfaceCanvasAmbientOptions
CanvasAmbientOptions Prop Type Default Description color string— CSS colour (default: the container's text colour). 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/falseforce it.maxDpr number2DPR cap 1–3 (default 2). reducedMotion ReducedMotion— — seed number7PRNG seed (default 7). trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().FloatingShapesOptionsinterfaceFloatingShapesOptions
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;manualwaits forplay().GradientShiftOptionsinterfaceGradientShiftOptions
GradientShiftOptions Prop Type Default Description angle number120Degrees (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;manualwaits forplay().GrainOptionsinterfaceGrainOptions
GrainOptions Prop Type Default Description blend "normal" | "overlay" | "soft-light" | "multiply" | "screen"overlaymix-blend-mode(defaultoverlay).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 number0.080–0.3 (default 0.08). reducedMotion ReducedMotion— — scale number1Texture scale 0.5–4 (default 1). trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().GridPatternOptionsinterfaceGridPatternOptions
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 booleantrueRadial 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;manualwaits forplay().MeshGradientOptionsinterfaceMeshGradientOptions
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;manualwaits forplay().ParticlesOptionsinterfaceParticlesOptions
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/falseforce it.max number— Upper bound (1–400, default 120). maxDpr number2DPR cap 1–3 (default 2). reducedMotion ReducedMotion— — seed number7PRNG 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;manualwaits forplay().PointerGlowOptionsinterfacePointerGlowOptions
PointerGlowOptions Prop Type Default Description color string— — intensity number0.350–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;manualwaits forplay().StarfieldOptionsinterfaceStarfieldOptions
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/falseforce it.max number— Upper bound (1–800, default 360). maxDpr number2DPR cap 1–3 (default 2). mode "drift" | "warp"— drift(default, sideways parallax) orwarp(stars fly outward; more vestibular).reducedMotion ReducedMotion— — seed number7PRNG seed (default 7). speed number0.250–1 (default 0.25). trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().twinkle number— Twinkle amplitude 0–1 (default 0.3; ≤ 1 Hz per star, no flashing). WavesOptionsinterfaceWavesOptions
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 number31–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;manualwaits forplay().wavelength number— px (80–1600, default 600). AmbientBlocktype"offscreen" | "hidden" | "reduced" | "toggle" | "paused"AmbientMotionTogglePropstypeAmbientMotionToggleProps
AmbientMotionToggleProps Prop Type Default Description label string"Pause background motion"Visible label (default "Pause background motion"); aria-pressedreports the paused state.Also accepts the props of: React DOM attributes.
AmbientStatetype"idle" | "running" | "paused" | "completed"AuroraPropstypeAuroraProps
AuroraProps Prop Type Default Description blobs number32–5 (default 3). children ReactNode— — colors readonly string[]— — controlRef RefObject<AmbientControl | null>— — duration number— ms of motion before resting (100–600000, default 5000) or Infinity(explicit; offer<AmbientMotionToggle>).intensity number0.6Layer 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
FloatingShapesPropstypeFloatingShapesProps
FloatingShapesProps Prop Type Default Description amplitude number— px (0–40, default 12). children ReactNode— — controlRef RefObject<AmbientControl | null>— — 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
GradientShiftPropstypeGradientShiftProps
GradientShiftProps Prop Type Default Description angle number120Degrees (default 120). children ReactNode— — colors readonly string[]— — controlRef RefObject<AmbientControl | null>— — 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
GrainPropstypeGrainProps
GrainProps Prop Type Default Description blend "normal" | "overlay" | "soft-light" | "multiply" | "screen"overlaymix-blend-mode(defaultoverlay).children ReactNode— — controlRef RefObject<AmbientControl | null>— — 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 number0.080–0.3 (default 0.08). reducedMotion ReducedMotion— — scale number1Texture scale 0.5–4 (default 1). trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().Also accepts the props of: React DOM attributes.
GridPatternPropstypeGridPatternProps
GridPatternProps Prop Type Default Description cell number— Cell in px (8–160, default 32). children ReactNode— — color string— — controlRef RefObject<AmbientControl | null>— — direction "diagonal" | "up" | "down" | "left" | "right"— — duration number— ms of motion before resting (100–600000, default 5000) or Infinity(explicit; offer<AmbientMotionToggle>).fade booleantrueRadial 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
MeshGradientPropstypeMeshGradientProps
MeshGradientProps Prop Type Default Description amplitude number— Point travel as a fraction of the box (0–0.3, default 0.12). children ReactNode— — colors readonly string[]— Base colour then 2–5 point colours (default a 4-point palette). controlRef RefObject<AmbientControl | null>— — 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
ParticlesPropstypeParticlesProps
ParticlesProps Prop Type Default Description children ReactNode— — color string— CSS colour (default: the container's text colour). controlRef RefObject<AmbientControl | null>— — 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/falseforce it.max number— Upper bound (1–400, default 120). maxDpr number2DPR cap 1–3 (default 2). reducedMotion ReducedMotion— — seed number7PRNG 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;manualwaits forplay().Also accepts the props of: React DOM attributes.
PointerGlowPropstypePointerGlowProps
PointerGlowProps Prop Type Default Description children ReactNode— — color string— — controlRef RefObject<AmbientControl | null>— — intensity number0.350–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;manualwaits forplay().Also accepts the props of: React DOM attributes.
StarfieldPropstypeStarfieldProps
StarfieldProps Prop Type Default Description children ReactNode— — color string— CSS colour (default: the container's text colour). controlRef RefObject<AmbientControl | null>— — 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/falseforce it.max number— Upper bound (1–800, default 360). maxDpr number2DPR cap 1–3 (default 2). mode "drift" | "warp"— drift(default, sideways parallax) orwarp(stars fly outward; more vestibular).reducedMotion ReducedMotion— — seed number7PRNG seed (default 7). speed number0.250–1 (default 0.25). trigger "mount" | "manual"— mount(default) starts at once;manualwaits forplay().twinkle number— Twinkle amplitude 0–1 (default 0.3; ≤ 1 Hz per star, no flashing). Also accepts the props of: React DOM attributes.
WavesPropstypeWavesProps
WavesProps Prop Type Default Description amplitude number— px (4–80, default 18). children ReactNode— — colors readonly string[]— — controlRef RefObject<AmbientControl | null>— — duration number— ms of motion before resting (100–600000, default 5000) or Infinity(explicit; offer<AmbientMotionToggle>).layers number31–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;manualwaits forplay().wavelength number— px (80–1600, default 600). Also accepts the props of: React DOM attributes.