Zephora UI

Other

Chart

Dependency-free static SVG chart: line, area, bar, pie and donut. Accepts labels plus one or more datasets, colors series from the token palette and titles every point for hover tooltips.

Import

import { Chart } from "@zephora/react";

Examples

Line and area

Line chart of Revenue, CostsJan — Revenue: 12Feb — Revenue: 19Mar — Revenue: 14Apr — Revenue: 25May — Revenue: 22Jun — Revenue: 30Jan — Costs: 8Feb — Costs: 11Mar — Costs: 10Apr — Costs: 14May — Costs: 12Jun — Costs: 16
  • Revenue
  • Costs
Area chart of Revenue, Costs

Bar

Multiple datasets render as grouped bars per label.

Bar chart of 2024, 2025Q1 — 2024: 40Q1 — 2025: 52Q2 — 2024: 55Q2 — 2025: 61Q3 — 2024: 48Q3 — 2025: 66Q4 — 2024: 70Q4 — 2025: 84
  • 2024
  • 2025

Pie and donut

Radial charts read the first dataset and use one slice per label.

Pie chart of ShareChrome: 62Safari: 20Firefox: 10Edge: 8
  • Chrome
  • Safari
  • Firefox
  • Edge
Donut chart of ShareChrome: 62Safari: 20Firefox: 10Edge: 8
  • Chrome
  • Safari
  • Firefox
  • Edge

API

Chart props

PropTypeDefaultDescription
type *"line" | "area" | "bar" | "pie" | "donut"Chart shape.
data *{ labels: string[]; datasets: Array<{ label: string; data: number[]; color?: string }> }Labels plus one or more datasets. Pie/donut read the first dataset.
widthnumber480SVG width in px.
heightnumber240SVG height in px.
showLegendbooleantrueRenders a legend under the chart.
showGridbooleantrueHorizontal gridlines (line/area/bar only).
strokeWidthnumber2Line thickness for line/area charts.
aria-labelstringAccessible chart summary; auto-generated from the type and dataset labels.
unstyledbooleanfalseHeadless mode — skips Zephora styling.