Horizontal Bar Chart

A lightweight horizontal bar chart where each row shows a label, a rounded bar scaled to the largest value and the number. No chart library, just Tailwind.

src/registry/ui/horizontal-bar-chart.tsx/r/horizontal-bar-chart.json

Installation#

bash
npx shadcn@latest add @minidev/horizontal-bar-chart

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/horizontal-bar-chart.json

Usage#

tsx
import { HorizontalBarChart } from "@/components/ui/horizontal-bar-chart"

export function Example() {
  return (
    <HorizontalBarChart data={[{label:"Design",value:42},{label:"Eng",value:68},{label:"Growth",value:35}]} />
  )
}

API reference#

HorizontalBarChart props
PropTypeDefault
dataBar[]SAMPLE_DATA
classNamestring-
labelstring"Horizontal bar chart"

Examples#

All chart components