Pro
Gift box
A wrapped gift for rewards, referral credit and welcome offers. It wobbles on hover; opening lifts the lid off with a small hop, pops the bow and raises the reward from inside.
pnpm dlx shadcn@latest add @caliper/gift-boxWhen to use
Use it for
- Welcome offers, referral rewards, achievements.
- Any single reward that should be discovered rather than shown.
Skip it when
- Rewards people must see to decide; show those up front.
- Repeated on every visit.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Closed means unreachable
- The reward is hidden from assistive technology and the keyboard until the box is open, and again when it closes.
Usage
- A disclosure button
- The box is a button with
aria-expandedthat names the gift, and the reward region is labelled. - Hover is a hint, not a requirement
- The wobble sits behind a hover media query; touch and keyboard open it directly.
Installation
pnpm dlx shadcn@latest add @caliper/gift-box
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { GiftBox } from "@/components/ui/gift-box"
The worked example comes with Pro
The 30-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
GiftBox
component
Also accepts the native props of its root element and a ref.
Accessibility
It exposes region semantics, with aria-label, aria-expanded and aria-controls kept in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Celebration burstOne small burst of confetti when a real milestone completes: the first deploy, a finished setup, a paid invoice. Skipped under reduced motion; the words say what happened.
- Scratch revealA scratch card. Rub the foil with a finger or the mouse and it comes away under the stroke; once enough is gone the rest lifts off and what was underneath settles into place. A Reveal button does the same from the keyboard.
- Card dealerA card table with a face-down deck, a fanned hand and a discard pile. Dealt cards arc off the deck and turn over in flight, played cards arc to the pile, sorting makes the hand's cards hop over each other into order, and collecting sweeps everything back.