Skip to content
caliper ui pro docs

Composition chart

Parts of a whole with a comparison to the previous period.

Pro
Revenue by plan250 k

Revenue by plan
PartValueSharePrevious
Solo4216.8%38
Team8835.2%70
Studio12048.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.md

The index of every part is at /llms.txt.

More in Category charts