Skip to content
caliper ui docs

Pro

Stamp card

A loyalty card with a stamp in each place. A new stamp lands oversize, settles into its place at a fixed tilt and sends one ring out, as a rubber stamp does. A last place shows the reward and lights when the card is full.

Pro
pnpm dlx shadcn@latest add @caliper/stamp-card

Rewards

Nine drinks, then one is on us.

Installs components/ui/stamp-card.tsxDepends on none beyond ReactMotion shared motion tokens

When to use

Use it for

  • Coffee, salon and retail loyalty programmes.
  • Any "collect nine, get one" mechanic.

Skip it when

  • Points that run into the hundreds; use `UsageMeter`.
  • Cards that expire without saying so beside the card.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

Only new stamps animate
Stamps already on the card stay still when the page loads or the card re-renders; only a stamp added now thumps in.

Styling

A fixed tilt per place
Each place has its own small tilt, so a card always looks hand-stamped the same way and never jitters.

Usage

A meter with the reward in words
It is a meter whose value text says how many are collected and what the reward is.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/stamp-card

Adds its 3 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. It is built from StampCard and stampTilt.

example.tsx
import { StampCard, stampTilt } from "@/components/ui/stamp-card"

The worked example comes with Pro

The 33-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

StampCard

component

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

PropTypeDefaultDescription
stamps *number—Stamps collected so far.
totalnumber9Stamps the card holds. The reward gets one more place after them.
rewardstring"Free coffee"What the full card earns, e.g. "Free coffee".

stampTilt

component

No props of its own; it accepts the native props of its root element.

Accessibility

It exposes meter semantics, with aria-label, aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext and aria-hidden kept in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.

All Surfaces examples