Skip to content
caliper ui docs

Pro

Coin jar

A savings jar. The coins inside stand for progress to the goal, twenty places in all; when the amount rises, new coins fall in from above the rim, one after another, and bounce once as they land.

Pro
pnpm dlx shadcn@latest add @caliper/coin-jar

Holiday fund

Add to the jar.

Installs components/ui/coin-jar.tsxDepends on none beyond ReactMotion shared motion tokens

When to use

Use it for

  • Savings goals, fundraisers and budgets in a fintech or family app.
  • Progress that should feel like a pile growing.

Skip it when

  • Exact figures in a dense table; use a `Meter`.
  • Goals with no end.

Decisions

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

Behaviour

Twenty places, not exact coins
The pile shows a share of the goal in steps of five percent; the exact amount is written beneath it.
Coins already there do not move
Only coins added by a rise in the amount fall, with a short stagger between them.

Usage

Amount and goal as a sentence
The meter's value text reads the amount, the goal and whether it has been reached.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/coin-jar

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 CoinJar and coinsFor.

example.tsx
import { CoinJar, coinsFor } from "@/components/ui/coin-jar"

The worked example comes with Pro

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

CoinJar

component

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

PropTypeDefaultDescription
value *number—Saved so far.
goal *number—
format((amount: number) => string)usdWrites an amount. Defaults to whole US dollars.
labelstring"Savings"What the jar is for, e.g. "Holiday fund".

coinsFor

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 Changing values examples