Diverging bar chart
Agree–disagree answers centred on neutral, so questions compare by sentiment. Segments grow outward from the centre line.
- The app is fast
- Pricing is fair
- Docs answer my questions
- Support is helpful
| Question | Strongly disagree | Disagree | Neutral | Agree | Strongly agree |
|---|---|---|---|---|---|
| The app is fast | 8 | 14 | 22 | 96 | 70 |
| Pricing is fair | 26 | 48 | 61 | 52 | 23 |
| Docs answer my questions | 12 | 30 | 44 | 88 | 36 |
| Support is helpful | 4 | 9 | 25 | 81 | 91 |
When to use
- Survey and NPS-style questions on a five or seven step scale.
- Comparing many questions on the same scale.
When not to use
- Scales without a neutral middle point that means something.
- A single question; a sentence with the percentages is clearer.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/diverging-bar-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
DivergingBarChart
6 props
PropTypeDefaultDescription
label *string—
scale *readonly string[]—Answer labels from most negative to most positive, e.g. five Likert steps.
rows *readonly DivergingRow[]—
loadingboolean—
errorstring—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-label, aria-busy and aria-hidden in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/diverging-bar-chart.mdThe index of every part is at /llms.txt.