EnterUI
DocsComponentsThemesExamplesDonation
Get Started
      • BarChart
      • DonutChart
      • LineChart
      • AreaChart
      • StackedBarChart
      • Heatmap

Default usage

  1. EnterUI
  2. /Docs
  3. /Data and Analytics
  4. /Metrics and Charts
  5. /Charts
  6. /BarChart
Updated 5 October 2026

BarChart

Rounded blue bars with quiet grid lines, labels, and hover values.

BarChart renders a token-colored SVG bar series suitable for dashboard cards and inline data summaries. It does not depend on a chart engine and stays accessible through an explicit label.

#Default usage

Deployments per day

One bar per data point; an optional baseline axis appears at the bottom.

1511.37.53.80
1: 42: 83: 64: 125: 96: 147: 11
Code
<BarChart
  data={[
    { value: 4 },
    { value: 8 },
    { value: 6 },
    { value: 12 },
    { value: 9 },
    { value: 14 },
    { value: 11 },
  ]}
  label="Deployments per day"
/>

#Import

Code
import { BarChart } from "@froggdesign/enter-ui-react";

#Accessibility

Provide an aria-label or label to name the chart group. Each bar exposes its category and value as a focusable button. Tab enters the bars; Left and Right Arrow move between adjacent values. Enter or Space reveals the focused value, and Escape dismisses the tooltip. Bar values remain exposed to assistive technology if the chart label is omitted; always supply a meaningful label in product screens.

#Scale and tooltips

The axis starts at zero and rounds the largest value up to a nearby readable bound: a largest value of 47 produces a maximum of 50. The plot uses the same bound as its labels, so bars remain inside the plot without excess empty space. BarChart displays nonnegative values; use LineChart or AreaChart for signed values. Non-finite values are treated as zero.

Compare monthly volume

Focus a bar and use Left or Right Arrow to compare exact values. Press Escape to dismiss the tooltip.

5037.52512.50
Jan: 32Feb: 47Mar: 39
JanFebMar

#API

  • data: array of { value, label? } entries.
  • label or aria-label: accessible name for the chart group.
  • height: pixel height (default 80).
  • color: optional CSS colour for bars (default uses the chart blue gradient).
  • showAxis: toggle the baseline axis (default true).
  • showGrid: toggle the dashed horizontal grid (default true).
  • Data labels appear beneath the plot when entries provide label; bars reveal values on hover and keyboard focus.

#Styling

Use height, showAxis, and showGrid to compose the chart. EnterUI owns its plot, axis, focus, and tooltip styling through .eui-* classes and --eui-* theme tokens.

Tooltips show exact values. A single series does not display a percentage share.

#Repeated axis labels

Repeated labels, such as the same hour on consecutive days, retain one axis entry per sample without React key warnings. Label text is presentation, not sample identity. The chart keeps its existing keyboard controls and tooltips.

Dense category axes show at most six labels while retaining every sample and keyboard tooltip. Below 600px, intermediate labels are reduced further and the first and final labels stay visible.

PreviousSparkline
NextDonutChart
On this page
  • Default usage
  • Import
  • Accessibility
  • Scale and tooltips
  • API
  • Styling
  • Repeated axis labels