Skip to Content
Liquid Glass UI
Components

Chart

Apple-styled Recharts data visualizations featuring system color palettes, hairline gridlines, Liquid Glass tooltips, and dot legends.

Fully compatible with the standard shadcn/ui Chart API (ChartContainer / ChartTooltip / ChartTooltipContent / ChartLegend / ChartLegendContent / ChartStyle and ChartConfig), rendering charts directly with Recharts primitives:

  • Apple system palette: --chart-1 through --chart-5 map to system Blue, Green, Orange, Purple, and Cyan with light/dark iOS 27 and macOS 27 values bundled in liquid-glass.
  • Liquid Glass Tooltip: Shares the menu glass tier reacting to the global glass tint, with bold headings, tabular numerals, and dot or rounded-line indicators.
  • Restrained axes: Secondary label ticks (12px mobile ↔ 11px desktop), system separator gridlines, and a subtle hover cursor.
  • Dot legends: ChartLegendContent uses circular color dots and secondary text that wraps automatically when constrained.
apple-liquid-ui/preview/chart-bar-demo
MacBook · 16:10

Installation (Shadcn Registry)

npx shadcn@latest add @apple-liquid/chart

Area Chart

apple-liquid-ui/preview/chart-area-demo
MacBook · 16:10

Donut Chart

apple-liquid-ui/preview/chart-donut-demo
MacBook · 16:10

Usage

import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts';
import {
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  type ChartConfig,
} from '@/components/ui/chart';

const data = [
  { month: 'Jun', desktop: 186 },
  { month: 'Jul', desktop: 305 },
];

const config = {
  desktop: { label: 'Desktop', color: 'var(--chart-1)' },
} satisfies ChartConfig;

export function Example() {
  return (
    <ChartContainer config={config} className="h-56 w-full">
      <BarChart data={data}>
        <CartesianGrid vertical={false} />
        <XAxis dataKey="month" tickLine={false} axisLine={false} />
        <ChartTooltip content={<ChartTooltipContent />} />
        <Bar dataKey="desktop" fill="var(--color-desktop)" radius={6} />
      </BarChart>
    </ChartContainer>
  );
}

Props API

ChartContainer

PropTypeDefaultDescription
configChartConfig—Defines label, icon, and color (or theme for light/dark) per data key, generating --color-<key> CSS variables
initialDimension{ width: number; height: number }320 × 200Fallback dimensions prior to initial layout measurement

ChartTooltipContent

PropTypeDefaultDescription
glassbooleantrueLiquid Glass material reacting to glass tint; false renders a 100% opaque surface
indicator'dot' | 'line' | 'dashed''dot'Series indicator style
hideLabelbooleanfalseHide the tooltip title row
hideIndicatorbooleanfalseHide series color indicators
nameKey / labelKeystring—Data keys used for series name and tooltip label

ChartLegendContent

PropTypeDefaultDescription
hideIconbooleanfalseHide custom icons from config and show color dots instead
nameKeystring—Data key used for legend item labels

On this page