Bar Chart

A production-ready, highly customizable bar chart component with zero configuration required. Perfect TypeScript support, advanced animations, and one-command installation.

CLI Installation
CSS Variables
Performance Optimized
Responsive
TypeScript
Zero Dependencies

Basic Example

A simple bar chart showing monthly revenue data with click interactions

Loading...
Selected: Click a bar to select

Examples

Explore different configurations and use cases for the BarChart component.

Product Sales - Custom Theme

Custom colors, axis labels, and value formatting

Loading...
Custom theme with product sales data • Advanced tooltips

Large Dataset Performance

50 data points with smooth performance and animations

Loading...
Large dataset with 50 data points • Smooth animations

Loading State

Error State

Chart Error
Network connection failed

Empty State

No Data
There's no data to display

API Reference

Complete TypeScript interface with all available props and configurations.

PropTypeDefaultDescription
datarequired
readonly T[]Array of data objects to display in the chart
xrequired
keyof TKey from data object to use for x-axis labels
y
keyof T'value'Key from data object to use for y-axis values
colors
readonly string[]DEFAULT_COLORSArray of colors to use for bars
height
number300Height of the chart in pixels
loading
booleanfalseShow loading state
error
string | nullnullError message to display
animation
booleantrueEnable entrance animations
onBarClick
(data: T, index: number) => voidCallback fired when a bar is clicked
className
stringAdditional CSS classes to apply to the container

Installation

Get started with the BarChart component in just a few steps.

Quick Install
bash
npx mario-charts@latest add bar-chart
Zero Lock-in Philosophy
The component is fully yours to own, modify, and customize. No external dependencies on our library.