Gift Box
A small real-time 3D gift box that bobs, wiggles on hover and opens on click: the bow and ribbon come undone, the lid lifts and sparkles rise. A floating launcher for an offer, a reward or a surprise.
pixikit.com/docs/components/gift-box
Customize
Box color
Ribbon color
Sparkle color
Size120px
Sparkles8
Float
Placement
Corner
Default open
Show label
Props
16| Name | Type | Default | Description |
|---|---|---|---|
boxColor | string | "#f4f2fa" | The box and lid colour; any CSS colour. |
ribbonColor | string | "#6d3cf0" | The ribbon and bow colour. |
sparkleColor | string | "#a78bfa" | The colour of the sparkles around the box and the burst when it opens. |
size | number | 120 | The box's width in pixels; its stage is a little larger so the open sequence has room. |
sparkles | number | 8 | How many sparkles drift around the closed box. |
float | boolean | true | The box bobs and sways while it waits. |
placement | "inline" | "corner" | "inline" | `inline` sits in its container; `corner` is fixed to a viewport corner and opens over a dimmed backdrop. |
corner | "bottom-right" | "bottom-left" | "bottom-right" | Which corner the `corner` placement uses. |
open | boolean | None | Opens or closes the box from outside. Leave it out and the box opens on click. |
defaultOpen | boolean | false | Whether it starts open when `open` is left out. |
onOpen | () => void | None | Called once the box has opened; when `open` is controlled, called on click so you can set it. |
onClose | () => void | None | Called when the box is closed. |
label | string | "Open the gift" | The accessible name of the launcher. |
showLabel | boolean | true | Shows `label` in a small pill beside the box on hover and focus. |
children | ReactNode | None | What is revealed once it opens, centred over the backdrop in `corner` or in place of the box in `inline`. |
className | string | None |