Work toward your own goal
Today
Walking
Your personal daily target
24 of 30 min
Shows a supplied activity amount and target with native progress, visible units, and distinct missing-data states.
Walking
18 of 30 minutes
Today
Walking
Your personal daily target
24 of 30 min
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { ActivityGoal } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/activity-goal.
npx @noorddev/vlak-cli add activity-goal
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/activity-goal.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { ActivityGoal } from "@noorddev/vlak-react";
<ActivityGoal label="Walking" description="Your personal goal for today" current={24} target={30} unit="min" />
<ActivityGoal label="Water recorded" current={null} target={null} unit="ml" />Progress toward a supplied activity goal, without recommended targets or scores.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | ReactNode | ||
description | ReactNode | ||
currentrequired | number | null | A supplied amount. null means no recorded amount; zero is a valid record. | |
targetrequired | number | null | A positive caller-owned goal. null means no goal has been set. | |
unitrequired | string |
Also accepts HTMLAttributes<HTMLDivElement>.
<div class="rs-activity-goal"><p class="rs-activity-goal-label" id="walking-goal">Walking</p><p class="rs-activity-goal-description">Your personal goal for today</p><p class="rs-activity-goal-value">24 <span class="rs-activity-goal-target">of 30 min</span></p><progress class="rs-activity-goal-progress" value="24" max="30" aria-labelledby="walking-goal" aria-valuetext="24 of 30 min">24 of 30 min</progress></div>