Components

Bar Chart

Compare categories with columns, grouped or stacked series, and horizontal bars.

Loading chart…

Weekly pickup orders
LocationOrders
North124
East186
Central238
West162
South208

Usage

Add one BarSeries per measure. Use stackId for stacks and layout="vertical" for horizontal bars.

Composition
<Chart.Root config={config}>
  <Chart.Legend />
  <Chart.ResponsiveContainer width="100%" height={280}>
    <Chart.BarChart data={data} animate accessibilityLayer aria-label="Pickup orders by location">
      <Chart.CartesianGrid vertical={false} />
      <Chart.XAxis dataKey="period" />
      <Chart.YAxis />
      <Chart.BarSeries dataKey="orders" radius={[5, 5, 0, 0]} />
      <Chart.Tooltip />
    </Chart.BarChart>
  </Chart.ResponsiveContainer>
</Chart.Root>

Bar uses explicit composition. Place Legend outside the plot; pair Root visibility with its callback for toggles.

Grouped and stacked series

Compare grouped loans or stack them with matching stackId and axes. Legend toggles recalculate the visible groups or stacks.

Loading chart…

Library loans
SubjectPrintDigital
Fiction184116
History12872
Science156104
Arts11288
Travel9664

Horizontal bars

Use layout="vertical" for horizontal bars, with numeric X and categorical Y axes.

Loading chart…

Workshop hours
TopicHours
Design ops42
Research36
Prototyping28
Testing24
Review18

Materials

Choose plain, paper, clay or glow. Set corner rounding with radius; stack caps are consumer-owned. Plot clipping can trim decorative halos.

Loading chart…

Weekly pickup orders
LocationOrders
North124
East186
Central238
West162
South208

Category emphasis

BarChart emphasis="category" dims other categories during hover or keyboard inspection. Root emphasis="none" disables it. Touch inspection does not activate hover emphasis.

Eligibility requires compatible values and marks in every visible series; see BarSeries below.

API reference

Focused props for explicit composition. Recharts owns grouping, stacking and axis geometry.

BarChart

Use inside Root and a sized ResponsiveContainer.

PropTypeDefaultDescription
dataRow[]—Consumer-owned category observations.
animateboolean | BarAnimationfalseReveal from numeric zero or nearest domain edge; respects reduced motion.
emphasis"none" | "category""none"Opt in to eligible category comparisons.
layout"horizontal" | "vertical""horizontal""horizontal" draws columns; "vertical" draws horizontal bars.
barGapnumber | string4Gap between grouped bars.
barCategoryGapnumber | string"10%"Space between category groups.
stackOffset"none" | "expand" | "wiggle" | "silhouette" | "sign" | "positive""none"Native stack calculation; use "sign" for separate positive/negative stacks.
accessibilityLayerbooleantrue in RechartsNative keyboard inspection; explicit in these components.
aria-label / aria-labelledbystring—Accessible plot name.
margin{ top?: number; right?: number; bottom?: number; left?: number }5 each sideSpace around plot parts.
childrenReactNode—Explicit axes, series, grid and tooltip.

Entrance stops on interaction or data/geometry changes. Remount to replay. BarAnimation accepts revealDurationMs (default 1000), revealEasing and hoverTransition. See Recharts BarChart.

BarSeries

String value keys identify config entries; controlled numeric keys or accessors require seriesKey.

PropTypeDefaultDescription
dataKeystring | number | ((row: Row) => unknown)RequiredValue field or accessor.
seriesKeystringString dataKeyMetadata and visibility identity.
stackIdstring | number—Stack series with matching axis IDs.
material"plain" | "paper" | "clay" | "glow""plain"Native-rectangle finish; custom paint takes precedence.
emphasisKey(payload: unknown) => string | number | undefined—Unique category identity; does not make invalid values or custom shapes eligible.
radiusnumber | [number, number, number, number]0Native corner rounding: top-left, top-right, bottom-right, bottom-left.
maxBarSizenumber—Limit each bar's thickness.
fillstringConfig colorNative fill override; Cells can customize individual bars.
hidebooleanfalseNative hide and Root selection both apply.
childrenReactNode—Native Cells, LabelList and ErrorBar composition.

Category emphasis requires native rectangles, chart-level rows, string value keys and finite non-baseline values. Use unique string categories or unique, defined emphasisKey results for every row.

Missing, null, zero/baseline or range values, per-series data, custom shapes and non-boolean activeBar disable category emphasis for the chart. Hidden peers do not block eligibility.

Finishes are static. Native per-series animation is disabled. Custom shape, filter or non-boolean activeBar owns paint. See Recharts Bar and material support.

Shared components

Root, SeriesConfig, Legend, Tooltip, Axes and grid, ResponsiveContainer.