konfeti - v0.6.0
    Preparing search index...

    Type Alias TextFormation

    TextFormation: FormationBase & {
        font?: string;
        image?: never;
        imageColors?: never;
        text: string;
        width?: never;
    }

    Formation Spelled from Text. The particles spell a word or a short message, centered on the burst's origin.

    Type Declaration

    • Optional Readonlyfont?: string

      Font. A CSS font shorthand (weight size family). Heavy weights read best, since the particles fill the letter strokes.

      "900 96px sans-serif"

      formation: { text: "GO!", font: "bold 140px 'Luckiest Guy'" }
      

      The size is the size on screen before fit scales the shape down. A web font that is still loading is waited for (through document.fonts). Worker instances only see fonts the worker itself knows: system fonts, or a FontFace loaded inside the worker.

    • Optional Readonlyimage?: never

      Not Used by Text Formations (set either text or image).

    • Optional ReadonlyimageColors?: never

      Not Used by Text Formations (particles keep their own colors).

    • Readonlytext: string

      Text. What the particles spell. \n starts a new line; lines are centered. Must not be empty.

      formation: { text: "LEVEL\nUP" }
      
    • Optional Readonlywidth?: never

      Not Used by Text Formations (the font size sets the size).

    Konfeti.fire({ formation: { text: "TEBRİKLER", font: "900 120px Inter" } });
    Konfeti.fire({ formation: { text: "YOU\nWIN", mode: "appear", hold: 1500 } }); // two lines