konfeti - v0.6.0
    Preparing search index...

    Type Alias TrailOptions

    Motion Trail Settings. Draws a short streak behind each particle through its last positions, thinning and fading toward the tail — sparks, comets, fireworks.

    Konfeti.fire({ paper: { trail: true } });
    Konfeti.fire({ shapes: [{ type: "star", trail: { length: 16, width: 4, color: "gold" } }] });

    Each trail segment is one stroke: length 10 costs about 10 extra draw calls per particle. Keep length modest for large bursts.

    type TrailOptions = {
        color?: ColorInput | "particle";
        length?: number;
        opacity?: Ratio;
        width?: Range<Pixels>;
    }
    Index
    color?: ColorInput | "particle"

    Trail Color. "particle" uses each particle's own (front) color.

    "particle"

    length?: number

    Trail Length. How many recent positions (one per frame) the trail runs through. Clamped to 2–32.

    10

    opacity?: Ratio

    Head Opacity. Opacity right behind the particle, fading to transparent at the tail. It is multiplied by the particle's own fade, so trails vanish with their particle. Clamped to 0–1.

    0.5

    width?: Range<Pixels>

    Head Width. Line width right behind the particle; the trail tapers to nothing at its tail.

    3

    Unit: pixels (CSS px).