Skip to content
caliper ui docs

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.

Pro
pnpm dlx shadcn@latest add @caliper/gift-box

Welcome gift

Open it.

20% off your first order

Code WELCOME20

Installs components/ui/gift-box.tsxDepends on none beyond ReactMotion none in component source

When 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-expanded that 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

terminal
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.

example.tsx
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
Checking your licence…

API reference

GiftBox

component

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
openboolean—
defaultOpenbooleanfalse
onOpenChange((open: boolean) => void)—
labelstring"Gift"Names the gift for assistive technology, e.g. "Welcome gift".

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.

All Surfaces examples