/
1.1k
Sponsor

Bar Chart

Horizontal and vertical bar chart with labels

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/bar-chart

Usage

import { BarChart } from "@/components/ui/bar-chart";
<BarChart
  data={[
    { label: "Mon", value: 12 },
    { label: "Tue", value: 28 },
  ]}
  width={40}
  showValues
  title="Weekly Traffic"
/>

API Reference

BarChart

PropTypeDefault
dataBarChartItem[]required
direction"horizontal" | "vertical""horizontal"
widthnumber30
heightnumber10
showValuesbooleantrue
titlestring-

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Screen reader: Visual output exposes its meaningful value through a textual alternative or bounded accessible summary.