Progress toward a goal with its context — raised against the target, the share, backers and the deadline with days left — for campaigns, pre-order thresholds and membership drives. The stock variant reads the same bar as units left of a run, warning when low and "Sold out" at zero. Built on Progress.
Reading rooms for every district
612 backers · 73%Ends December 31
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { GoalMeter } from "@vamos-ui/react";
<GoalMeter label="Spring campaign" value={182400} goal={250000} backers={612} deadline="2026-12-31" />
<GoalMeter variant="stock" size="compact" value={6} goal={40} />role="progressbar" with one aria-valuetext sentence ("$182,400 of $250,000 raised, 73%"); the big figure is hidden from screen readers so it is not read twice.
Low stock and sold out are stated in text, not only in the bar colour.
Examples
Stock left
variant="stock": units left of a run; warning at or below lowAt (20%), sold out at zero.
Canvas jacket
Wool overshirt
Almost gone
Field trousers
Compact, other units
format="number" or a function for goals that are not money; labels rename backers.
Pre-orders until production starts
38 orders · 76%
Membership drive
Goal reached ·107%Ended March 1
API
GoalMeter
| Prop | Type | Default |
|---|---|---|
value / goalRaised and target — or units left and the run (stock). | number | — |
variantRaised against a target, or stock left. | "goal" | "stock" | "goal" |
labelEyebrow: campaign or product name. | ReactNode | — |
backersBackers, donors, orders (rename with labels.backers). | number | — |
deadline / nowEnd date. Days left appear with now, or after hydration (the server renders the date only). | string | Date | — |
format / currencyHow the amounts read. | "currency" | "number" | (n) => string | currency (goal), number (stock) |
lowAtStock share at which the bar turns warning. | number | 0.2 |
sizeCompact for cards and heroes. | "default" | "compact" | "default" |
footerA line under the meter. | ReactNode | — |
labelsDictionary namespace "goalMeter": meter, stockMeter, of, valueText, percent, backers, ends, ended, daysLeft, lastDay, reached, left, soldOut, low. | Partial<GoalMeterLabels> | — |
daysUntil(deadline, now)
| Prop | Type | Default |
|---|---|---|
returnsWhole days to the end of the deadline day; 0 on the last day, −1 once past. | number | — |