Effect · ambient layer

Petals effect

The Zeenat petals effect drifts bounded, seeded petal forms across a website. The effect is framework-neutral and is also used by the built-in Spring preset.

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 { petals } from "zeenat/effects";
// or
import { petals } from "zeenat/effects/petals";

Basic usage

Petals.tsx
import { ZeenatScene } from "zeenat";
import { petals } from "zeenat/effects/petals";

const effects = [petals()];

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

petals() options

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

PropertyTypeRequiredDefaultDescription
colorsreadonly string[]No["#f9a8d4", "#fecdd3", "#fdf2f8"]CSS colors used for petal forms.
countnumberNo22Base petal count before density scaling.
opacitynumberNo0.62Maximum petal opacity.
sizereadonly [number, number]No[8, 15]Minimum and maximum petal size in CSS pixels.
driftnumberNo60Horizontal travel in CSS pixels.
rotationnumberNo600Maximum rotation per fall cycle in degrees.
fallSpeednumberNo1Duration multiplier; values below 1 fall faster, clamped to at least 0.2.
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
petals({ count: 10, opacity: 0.35, drift: 24, fallSpeed: 1.25 })

Intense

Intense
petals({ count: 40, size: [8, 19], drift: 90, rotation: 900 })

Combined

Combined
const effects = [petals({ count: 18 }), sparkles({ colors: ["#f472b6", "#86efac"], opacity: 0.28 })];

Reduced motion

A sparse static arrangement remains, with no falling or rotation animation.

Read the complete reduced-motion contract

Performance notes

The shared falling-element renderer bounds counts, scales for viewport and animates only transform and opacity.

Zeenat performance architecture