EEnterUI
DocsComponentsThemesDonation
Get Started
      • BarChart
      • DonutChart
      • Legend
EnterUIDocsData AnalyticsMetrics and ChartsChart PrimitivesLegend
Data AnalyticsUpdated 6 May 2026

Legend

Small labelled-swatch list used to caption charts and dashboards.

Legend renders a list of labelled swatches with optional values. Use it next to a DonutChart, BarChart, or Sparkline to caption colour mappings.

#Default usage

Inline legend

Horizontal layout pairs colour with label and optional value.

  • Stable62%
  • Beta28%
  • Alpha10%
Code
<Legend
  items={[
    { label: "Stable", value: "62%" },
    { label: "Beta", value: "28%" },
    { label: "Alpha", value: "10%" },
  ]}
/>

#Import

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

#Accessibility

Legend renders a semantic <ul> of labelled items. Swatches are aria-hidden so screen readers focus on the labels and values.

#API

  • items: array of { label, value?, color? } entries.
  • orientation: horizontal (default) or vertical.
  • Extends ul props.

#Styling

Every exported component accepts className when it renders an element. EnterUI styles use .eui-* classes and --eui-* variables mapped from FroggDesign theme tokens.

PreviousDonutChart
NextSkeleton

On this page

  1. Default usage
  2. Import
  3. Accessibility
  4. API
  5. Styling