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.
pnpm dlx shadcn@latest add @caliper/coin-jarWhen 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
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.
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
API reference
CoinJar
component
Also accepts the native props of its root element and a ref.
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.
Related
- Liquid gaugeA round gauge filled to its value with liquid: two waves roll across the surface, a few bubbles rise, and a new value pours in or drains with a small settle. The reading turns to the liquid's text colour exactly where the liquid covers it.
- Usage budgetA budget bar with spend, limit and a pace marker.
- Progress ringDeterminate progress in a ring that eases to each value, draws a check when done and a cross when it fails.