GoalStat

A number chasing a target. The ring fills to the share done while the figure counts up; it turns green and ticks when the goal is met. Cards.

Open playground
0%

Quarterly revenue

$0

of $90,000

19 days left

About

GoalStat is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { GoalStat } from "@ashutoshswamy/smoui" and set label, value, prefix among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { GoalStat } from "@ashutoshswamy/smoui";

<GoalStat label="Quarterly revenue" value={68400} goal={90000} prefix="$" note="19 days left" />

Props 4

label

What is being measured.

string
value / goal

Progress and target.

number
prefix / suffix

Around both numbers.

string
note

Line under the figures. Replaced by Goal reached once met.

string