Brickslab.Toolsv2.1.1

@brickslab./ui-web

Interactive button that triggers confetti animation on click. Combines the Confetti component with a button for easy celebration triggers.

Aperçu

Default ConfettiButton

With Custom Confetti Options

Multiple Variants

Props Table

PropTypeDéfautRequisDescription
childrenReact.ReactNodeButton label or content.
optionsPartial<ConfettiProps>Configuration for confetti animation.
disabledbooleanfalseDisable the button.
onClick() => voidCallback triggered on click.
classNamestringAdditional CSS class.
Override rapide

Tous les paramètres listés dans cette table sont overrideables via les props. Utilisez ce squelette comme point de départ.

<MyComponent
  children={<span>...</span>}
  options={...}
  disabled={false}
  onClick={...}
  className="..."
/>
childrenoptionsdisabledonClickclassName

Usage

tsx
import { ConfettiButton } from "@brickslab./ui-web";

// Basic usage
<ConfettiButton>Celebrate!</ConfettiButton>

// Custom confetti
<ConfettiButton
  options={{
    particleCount: 150,
    angle: 45,
    spread: 90,
    colors: ["#CC4A48", "#4ADE80"],
  }}
>
  Success!
</ConfettiButton>

// With callback
<ConfettiButton onClick={() => console.log("Clicked!")}>
  Click me
</ConfettiButton>