Pro
Balance scale
A balance for comparing two amounts: costs and benefits, budget and actual, before and after. The beam tilts toward the heavier side and settles with a small overshoot while the pans hang level the whole way.
pnpm dlx shadcn@latest add @caliper/balance-scaleWhen to use
Use it for
- Pros and cons, build versus buy, plan versus actual.
- A verdict that should be felt before it is read.
Skip it when
- More than two sides; use a chart.
- Values that are not comparable in one unit.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Pans counter-turn
- The pans share the beam's angle and easing, turned the other way, so they stay level through the overshoot.
- Twice as heavy is the limit
- The tilt grows with the difference as a share of the heavier side and stops at the maximum, so huge numbers do not tip it over.
Usage
- Read as a verdict
- The image is named with both values and which side outweighs, for example Buy outweighs Build.
Installation
pnpm dlx shadcn@latest add @caliper/balance-scale
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. It is built from BalanceScale and tiltFor.
import { BalanceScale, tiltFor } from "@/components/ui/balance-scale"
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
BalanceScale
component
Also accepts the native props of its root element and a ref.
tiltFor
component
No props of its own; it accepts the native props of its root element.
Accessibility
It exposes img semantics, with aria-hidden and aria-label 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
- Comparison blockThe switch, row by row: the same task the old way and with your product, side by side.
- Budget varianceBudget against actual by line, with variance.
- Diverging bar chartAgree–disagree answers centred on neutral, so questions compare by sentiment. Segments grow outward from the centre line.