SpendBar
Usage against a cap, with the cap state stated rather than derived.
Default
The ordinary case: a number, its cap, and the state a policy says that number is in.
Usage
import { SpendBar } from '@oceanic-hub/brand-system'One of four meters, and the four answer four questions. Progress marks a task with
an end — it has a finish line, and 100 means done. EngagementBar measures a rate, how often
rather than how much, with no finish line at all. FitScore renders a 0–100 score. This one
measures a quantity against a policy-set cap, and alone among the four it carries a cap-state of
its own — the other three have no equivalent, because none of them has a ceiling to be near.
Oceanic-only, and shadcn's progress docs page is a nearest relative at best, not a
counterpart to pair against: its own examples are a bare value, a label-and-value composition,
a slider-controlled bar and an RTL demo — nothing about a budget, a cap, or a state a caller
supplies rather than computes. A reader who wants generic task completeness reaches for
Progress instead; this component is not a smaller Progress, it answers a different
question.
capState is deliberately supplied rather than computed from used / cap: where
"near" starts is a policy decision that belongs to the product, and a component that guesses
it will be wrong in one product and unfixable in the other. See
spend-bar.contract.test-d.ts for the full argument — it is the model for how this repo
argues a prop shape.
format denominates the numbers; the default names no currency, on purpose — see the demo
below. hideLabel drops the footer caption, and is safe exactly when the number is already
stated beside the bar, the same condition EngagementBar's hideValue carries for its own
footer.
Cap states
The threshold is a policy, not arithmetic — the surface says which side of it this number is on, so two products with the same numbers can still disagree about when to warn.
Denominating the numbers
The default names no currency. format is the seam — pass it to denominate.
In a compact list
Pass hideLabel when the row already states the number beside the bar — a list of workspaces, say — so the "% used · cap" caption is not repeated once per row.
API Reference
See the SpendBar API page for every prop of every part, with types, defaults and the contract that pins them.
ProductShell
The frame a product composes instead of builds — rail, top bar, phone sheet, user menu and scope breadcrumb, in an agency and a client variant.
StatusPill
The one status vocabulary every product shares — reach for it instead of a hand-rolled badge, or two surfaces end up disagreeing about what "done" means.