konfeti - v0.6.0
    Preparing search index...

    Type Alias PathShapeDefinition<TOptions>

    Path-Based Custom Shape. Return a path once per burst; the library fills, strokes, shades, flips and glints it like any built-in vector shape (gradients, shine and stroke all work).

    defineShape("diamond", {
    viewBox: [24, 24],
    path: ({ sharpness = 0.5 }) => `M12 0 L${24 - sharpness * 12} 12 L12 24 L${sharpness * 12} 12 Z`,
    });
    type PathShapeDefinition<TOptions extends object> = {
        defaultSize?: Range<Pixels>;
        path: (options: Readonly<TOptions>) => string | Path2D;
        viewBox?: readonly [width: number, height: number];
    }

    Type Parameters

    • TOptions extends object
    Index
    defaultSize?: Range<Pixels>

    Size When the Entry Sets None.

    [12, 18]

    path: (options: Readonly<TOptions>) => string | Path2D

    Build the Path from Entry Options. An SVG d string or a Path2D, in viewBox coordinates.

    viewBox?: readonly [width: number, height: number]

    Path Coordinate Box as [width, height].

    [24, 24]