ComponentsData display

Goal meter

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.

Progress components/goal-meter.tsxtheme · material · accent · density · font

Reading rooms for every district

612 backers · 73%Ends December 31

Every gift is itemised in the yearly report.

Installation

$ pnpm add @vamos-ui/react

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

PropTypeDefault
value / goal
Raised and target — or units left and the run (stock).
number—
variant
Raised against a target, or stock left.
"goal" | "stock""goal"
label
Eyebrow: campaign or product name.
ReactNode—
backers
Backers, donors, orders (rename with labels.backers).
number—
deadline / now
End date. Days left appear with now, or after hydration (the server renders the date only).
string | Date—
format / currency
How the amounts read.
"currency" | "number" | (n) => stringcurrency (goal), number (stock)
lowAt
Stock share at which the bar turns warning.
number0.2
size
Compact for cards and heroes.
"default" | "compact""default"
footer
A line under the meter.
ReactNode—
labels
Dictionary namespace "goalMeter": meter, stockMeter, of, valueText, percent, backers, ends, ended, daysLeft, lastDay, reached, left, soldOut, low.
Partial<GoalMeterLabels>—

daysUntil(deadline, now)

PropTypeDefault
returns
Whole days to the end of the deadline day; 0 on the last day, −1 once past.
number—