Skip to content
caliper ui docs

Pro

Diverging bar chart

Agree–disagree answers centred on neutral, so questions compare by sentiment. Segments grow outward from the centre line.

Pro
pnpm dlx shadcn@latest add @caliper/diverging-bar-chart

Q3 customer survey

210 workspace admins answered in September 2026.

How much do you agree?
  • The app is fast
  • Pricing is fair
  • Docs answer my questions
  • Support is helpful
How much do you agree?
QuestionStrongly disagreeDisagreeNeutralAgreeStrongly agree
The app is fast814229670
Pricing is fair2648615223
Docs answer my questions1230448836
Support is helpful49258191
Installs components/ui/diverging-bar-chart.tsxDepends on d3-shapeMotion none in component source

When to use

Use it for

  • Survey and NPS-style questions on a five or seven step scale.
  • Comparing many questions on the same scale.

Skip it when

  • 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 3 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source. It is built from divergingShares and DivergingBarChart.

example.tsx
import { divergingShares, DivergingBarChart } from "@/components/ui/diverging-bar-chart"

The worked example comes with Pro

The 33-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

divergingShares

component

No props of its own; it accepts the native props of its root element.

DivergingBarChart

component
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—

Accessibility

It is built on native elements and keeps aria-label, aria-busy and aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Category charts examples