Skip to content
Uxelith
Sign in
Prov1.0.0Data

Bar Chart

A responsive bar chart, grouped or stacked: bars rise in one after another, the hovered column lights up and the tooltip glides, with keyboard navigation and a hidden data table.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
9 Oct 2026
Live

Installation

Usage

example.tsx
"use client"

import { BarChart } from "@/components/bar-chart"

export function Revenue() {
  return (
    <BarChart
      title="Revenue, 2026"
      series={[{ key: "revenue", label: "Revenue" }]}
      data={[
        { label: "Jan", revenue: 18400 },
        { label: "Feb", revenue: 21300 },
        { label: "Mar", revenue: 19800 },
      ]}
    />
  )
}

Props

PropTypeDefaultDescription
data{ label: string; [key]: number }[]—One entry per category.
series{ key; label; color? }[]—Series drawn side by side.
titlestring—Names the chart and its data table.
showTitlebooleantrueShow the title above the chart.
format(value: number) => string—Formats axis, tooltip and table values. Overrides formatOptions.
formatOptions / localeIntl.NumberFormatOptions / stringcompact, visitor's localeNumber format without a function, e.g. { style: "currency", currency: "USD" }.
heightnumber240Plot height in pixels.
legendbooleanautoShown automatically for 2+ series.
stackedbooleanfalseStack the series in one bar per category; the tooltip adds a total.
--chart-1 / -2 / -3CSS variablesthemeSeries colours.

Accessibility

  • A labelled <figure>; the full data is also available as a visually hidden table.
  • Each bar is announced as "Mar, Revenue: $19.8K"; Tab enters the chart, arrow keys and Home/End move between bars.
  • The tooltip follows hover and keyboard focus.
  • Bars appear without growing under prefers-reduced-motion.

Changelog

  1. v1.0.0Latest

    First release.

More in Data

All 9 in Data
  • DataPro

    Area Chart

    Trends over time: lines draw themselves in, the crosshair glides between points, the area you've scrubbed stays bright, and the tooltip shows the change from the point before.

  • DataFree

    Avatar Stack

    Overlapping avatars that spread on hover, with a name tooltip that swings with the pointer, status dots and a +N list of everyone else. Photos or initials.

  • DataPro

    Data Table

    A real, accessible table with natural sorting where rows glide into place, highlighted search, pagination, drawn checkboxes and a bulk-action bar. Typed columns, custom cells, two densities.