retro ui logo
RetroUI
  • Components
  • Blocks
  • Templates
  • Figma
Sign InGet Access

Getting Started

IntroductionInstallationThemesChangelogMCP ServerBlocksProTemplatesProFigma KitPro

Components

AccordionAlertAvatarBadgeBreadcrumbButtonCardCalendarCarouselCheckboxCommandDialogDrawerNewEmptyNewInputLabelLoaderMenuContext MenuPopoverProgressRadioSelectSliderSonnerSwitchTabTableTable Of ContentsNewTextareaTextToggleToggle GroupTooltip

Chart

Bar ChartUpdatedLine ChartArea ChartPie Chart

Utilities

cn
RetroUI

RetroUI

The platform for developers and designers who love unique, playful, and brutalist design.

PRODUCT
  • OS Components
  • UI Blocks
  • Templates
  • Figma Kit
  • Themes
  • Neo Screenshot
SUPPORT
  • Pricing
  • FAQ
  • Documentation
  • Changelog
  • Discord Community
  • Email Support
COMPANY
  • Blog
  • Contact
  • Terms of Use
  • Privacy Policy
Footer decoration

© 2026 AZENCOT LLC. ALL RIGHTS RESERVED.

Bar Chart

A customizable bar chart component to visualize your data with support for multiple categories, custom colors, and horizontal alignment. 📊

Source


Installation

pnpm dlx shadcn@latest add 'https://retroui.dev/r/bar-chart.json'


Examples

Default



Grouped Data



Stacked Data



Horizontal Alignment



API Reference

PropTypeDefaultDescription
dataRecord<string, any>[][]Array of data objects to display
indexstring-Key for the x-axis (category) data
categoriesstring[][]Array of keys for the data values to display as bars
alignment"vertical" | "horizontal""vertical"Orientation of the bars
strokeColorsstring[]["var(--foreground)"]Array of stroke colors for the bars
fillColorsstring[]["var(--primary)"]Array of fill colors for the bars
tooltipBgColorstring"var(--background)"Background color for tooltips
tooltipBorderColorstring"var(--border)"Border color for tooltips
gridColorstring"var(--muted)"Color for the grid lines
valueFormatter(value: number) => string(value) => value.toString()Function to format values
showGridbooleantrueWhether to show grid lines
showTooltipbooleantrueWhether to show tooltips on hover
stackedbooleanfalseWhether to stack the bars
classNamestring-Additional CSS classes

Last Updated: 02 Jan, 2026

On this Page

  • Installation [#installation]
  • Examples [#examples]
    • Default [#default]
    • Grouped Data [#grouped-data]
    • Stacked Data [#stacked-data]
    • Horizontal Alignment [#horizontal-alignment]
  • API Reference [#api-reference]