Effect · ambient layer

Sparkles effect

The Zeenat sparkles effect places small CSS shapes across a configurable portion of the viewport. Seeded positioning makes the scene repeatable, while the animation stays outside React's render cycle.

Installation and imports

Install Zeenat once, then use the aggregate effects entry or the smallest explicit subpath. Both paths are exported by package version 0.3.0.

Install
npm install zeenat
Imports
import { sparkles } from "zeenat/effects";
// or
import { sparkles } from "zeenat/effects/sparkles";

Basic usage

Sparkles.tsx
import { ZeenatScene } from "zeenat";
import { sparkles } from "zeenat/effects/sparkles";

const effects = [sparkles({ colors: ["#fbbf24", "#ffffff"] })];

export function Decoration() {
  return <ZeenatScene effects={effects} />;
}

sparkles() options

Properties marked required have no factory default. Every other value below is taken from the current TypeScript source.

PropertyTypeRequiredDefaultDescription
colorsreadonly string[]YesrequiredOne or more CSS colors used across sparkle marks.
countnumberNo24Base mark count before intensity, viewport and motion scaling.
shape"circle" | "diamond" | "star"No"diamond"CSS geometry used for each sparkle.
maxYnumberNo0.9Maximum vertical placement as a clamped viewport fraction.
opacitynumberNo0.62Peak sparkle opacity during full motion.
layer"background" | "ambient" | "foreground" | "top"No"ambient"Semantic layer used to order the effect inside the Zeenat scene.
ordernumberNoOptional ordering value among effects in the same semantic layer.

Examples

Subtle

Subtle
sparkles({ colors: ["#fde68a"], count: 8, opacity: 0.25, shape: "circle" })

Intense

Intense
sparkles({ colors: ["#f43f5e", "#fbbf24", "#38bdf8"], count: 42, shape: "star" })

Combined

Combined
const effects = [petals({ count: 14 }), sparkles({ colors: ["#f9a8d4"], count: 9 })];

Reduced motion

A sparse, static set of marks remains visible at opacity 0.34.

Read the complete reduced-motion contract

Performance notes

Uses bounded spans animated only with transform and opacity. Reduced motion and small screens lower density.

Zeenat performance architecture