Skip to content
PixiKit

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
NameTypeDefaultDescription
boxColorstring"#f4f2fa"The box and lid colour; any CSS colour.
ribbonColorstring"#6d3cf0"The ribbon and bow colour.
sparkleColorstring"#a78bfa"The colour of the sparkles around the box and the burst when it opens.
sizenumber120The box's width in pixels; its stage is a little larger so the open sequence has room.
sparklesnumber8How many sparkles drift around the closed box.
floatbooleantrueThe 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.
openbooleanNoneOpens or closes the box from outside. Leave it out and the box opens on click.
defaultOpenbooleanfalseWhether it starts open when `open` is left out.
onOpen() => voidNoneCalled once the box has opened; when `open` is controlled, called on click so you can set it.
onClose() => voidNoneCalled when the box is closed.
labelstring"Open the gift"The accessible name of the launcher.
showLabelbooleantrueShows `label` in a small pill beside the box on hover and focus.
childrenReactNodeNoneWhat is revealed once it opens, centred over the backdrop in `corner` or in place of the box in `inline`.
classNamestringNone

Related