Honest Bar

Honest Bar is a copy-paste React component that stops bar chart made 9% look like 3× before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/honest-bar
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsBar chart made 9% look like 3×

Was this component page useful?

How do I install Honest Bar?

pnpm dlx shadcn@latest add @bollard/honest-bar

The files land in your project. They're yours to edit.

How do I use Honest Bar in React?

honest-bar-usage.tsx
import { HonestBar } from "@/components/ui/honest-bar"

<HonestBar label="Monthly active users" data={users} min={9000} />

What input mistakes does Honest Bar catch?

  • Truncated value axis that makes small differences look large
  • Values clipped past the scale: torn and labelled
  • Exaggeration stated as drawn ratio vs real ratio

What props does Honest Bar accept?

HonestBar props
PropTypeDefault
data* (required)

Bars, in order.

HonestBarDatum[]—
label* (required)

Accessible name of the chart, also shown as its caption.

string—
orientation

"vertical" columns (default) or "horizontal" bars.

"vertical" | "horizontal""vertical"
min

Where the value axis starts. Above zero triggers the truncation warning and broken-axis mark.

number—
max

Where the value axis ends. Values past it are drawn torn and labelled with their real value.

number—
size

Plot height in px (vertical) or height per bar (horizontal).

number—
format

Short format for ticks and labels.

(value: number) => string(v) => compact.format(v)
exactFormat

Exact format for the hover/focus readout.

(value: number) => string(v) => exact.format(v)
truncatedText

Templates: `{min}`, `{drawn}`, `{real}` and `{count}` are filled in.

string"The axis starts at {min}, not 0: the longest bar looks {…
cutOffText

Label for a bar that runs past the scale.

string"The axis starts at {min}, not 0, so bar lengths aren't p…
clippedText

Message when bars are clipped at max.

string"{count} past the edge of the scale, labelled with the re…
fixLabel

Button text that resets the axis to start at 0.

string"Start at 0"
undoLabel

Button text that restores the original axis.

string"Undo"

* required. Also accepts the native props of <figure> (className, aria-*, data-*…), passed through to it.

How is Honest Bar accessible?

  • Chart is a labelled list; each bar is a focusable listitem with an aria-label holding the exact value
  • Arrow keys, Home and End move between bars
  • Status about truncation is in a polite live region
  • The broken-axis warning has text, not only a visual mark

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • One series of bars; not a general charting library
  • The lie factor compares longest and shortest bars only
  • Ignores other distortions such as 3D, dual axes or log scales

What expensive mistakes does Honest Bar stop?

Bar chart made 9% look like 3×

Also known as

bar chart · y axis · start at zero · broken axis · svg chart · data viz · dashboard · recharts

Field type

What dependencies does Honest Bar require?

Honest Bar facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameHonest Bar
Registry identifier@bollard/honest-bar
Install commandnpx shadcn@latest add @bollard/honest-bar
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Honest Bar

What form validation mistake does Honest Bar catch?

Honest Bar prevents bar chart made 9% look like 3×. A bar chart that admits when its axis doesn't start at zero and says how much that exaggerates, like "looks 3×, really 1.09×". Catches: Truncated value axis that makes small differences look large, Values clipped past the scale: torn and labelled, Exaggeration stated as drawn ratio vs real ratio. Limitation: validate honest-bar schemas on backend.

How do I install honest-bar with shadcn?

Run `npx shadcn@latest add @bollard/honest-bar`. Sources added: registry/default/honest-bar/honest-bar.tsx. Package requirements: lucide-react.

What props customize Honest Bar?

Honest Bar accepts `data`, `label`, `orientation`, `min`, `max`. Configures bar chart, y axis, start at zero behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of honest-bar?

One series of bars; not a general charting library. The lie factor compares longest and shortest bars only. Ignores other distortions such as 3D, dual axes or log scales Server requirement: backend verification for honest-bar.

How does Honest Bar meet accessibility guidelines?

Chart is a labelled list; each bar is a focusable listitem with an aria-label holding the exact value. Arrow keys, Home and End move between bars. Status about truncation is in a polite live region. The broken-axis warning has text, not only a visual mark. Minimizes errors: misleading bar chart, y axis not starting at zero.

Which components pair with Honest Bar?