sigilUI

Bar Chart

Compare values across categories with labeled bars.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { BarChart } from "@sigil-ui/components";

Usage

<BarChart
    groups={[
      { label: "Jan", bars: [{ label: "Revenue", value: 42 }, { label: "Cost", value: 28 }] },
      { label: "Feb", bars: [{ label: "Revenue", value: 58 }, { label: "Cost", value: 31 }] },
      { label: "Mar", bars: [{ label: "Revenue", value: 75 }, { label: "Cost", value: 35 }] },
      { label: "Apr", bars: [{ label: "Revenue", value: 63 }, { label: "Cost", value: 29 }] },
    ]}
  />

Props

PropTypeDefaultDescription
groupsBarChartGroup[]——
direction"vertical" | "horizontal"——
showValuesbooleantrueShow value labels on bars.
showGridbooleantrueShow gridlines.
maxBarSizenumber200Maximum bar height/width in px.

Token integration

CSS VariablePurpose
--s-primaryPrimary
--s-successSuccess
--s-warningWarning
--s-errorError
--s-infoInfo
--s-font-monoFont mono
--s-text-mutedText muted
--s-borderBorder
--s-radius-smRadius sm
--s-duration-normalDuration normal
--s-surface-elevatedSurface elevated
--s-primary-contrastPrimary contrast