Celebration
Confetti, a burst of sparks or rising emoji for a moment worth marking, fired from code or a click.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
kind | CelebrationKind | confetti | confetti, burst or emoji. |
trigger | 'none' | 'click' | none | click plays it from wherever the reader clicks inside the element; none waits for fire(). |
emoji | string[] | [] | The emoji that kind="emoji" throws. Default: 🎉 ✨ 👏. |
Slots
| Name | Description |
|---|---|
(default) | The content it wraps, such as the button that fires it with trigger="click". |
Events
| Name | Type | Description |
|---|---|---|
celebration-end | CustomEvent<void> | Fired when the last particle is gone. Does not bubble. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-celebration--colors | color | rgb(2, 101, 220), #f59e0b, #10b981, #ec4899, #8b5cf6 | A comma-separated list the confetti and sparks take their colours from. |
--c2-celebration--count | number | 80 | Particles per confetti fire; a burst throws a third, emoji a tenth. |
--c2-celebration--spread | angle | 70deg | How wide the confetti is thrown. |
--c2-celebration--duration | time | 2500ms | How long a particle lives. |
--c2-celebration__emoji--size | pixel | 28px | |
--c2-celebration__confetti--size | pixel | 8px | |