Componentcharts0.69 KB gzipZero dependencies
Bar Chart
Mini data bar chart with dashed guideline grids and hover zoom.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add bar-chartOr install the full npm package:
npm install bigbulluiUsage
tsx8 lines
import { BarChart } from "@/components/ui/bar-chart"; <BarChart data={[ { label: "A", value: 40 }, { label: "B", value: 80, tone: "accent" }, ]}/>Source code
bar-chart.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxbar-chart.tsx77 lines
import * as React from "react";import { cn } from "./lib/utils"; export interface BarChartItem { label: string; value: number; tone?: "default" | "accent";} export interface BarChartProps extends React.HTMLAttributes<HTMLDivElement> { data: BarChartItem[]; height?: number; showValues?: boolean; className?: string;} export function BarChart({ data = [],Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { BarChart } from "@/components/ui/bar-chart"; <BarChart />| Prop | Type | Description |
|---|---|---|
| data | BarChartItem[] | Dataset array rendered in charts, grids, or tables. (Default: []) |
| height | number | Configures height. (Default: 160) |
| showValues | boolean | Toggles show values. (Default: true) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |