Composition chart
Parts of a whole with a comparison to the previous period.
| Part | Value | Share | Previous |
|---|---|---|---|
| Solo | 42 | 16.8% | 38 |
| Team | 88 | 35.2% | 70 |
| Studio | 120 | 48.0% | 128 |
When to use
- Mix shifts, such as revenue by plan versus last quarter.
- A readable alternative to a pie.
When not to use
- There is no previous period.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/composition-chart
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
CompositionChart
7 props
PropTypeDefault
label *string—
data *readonly CompositionPart[]—
unitstring""
formatValue((value: number) => string)numberText
loadingboolean—
errorstring—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group and status semantics, with aria-label, aria-busy, aria-hidden and aria-pressed kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/composition-chart.mdThe index of every part is at /llms.txt.