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-1through--chart-5map to system Blue, Green, Orange, Purple, and Cyan with light/dark iOS 27 and macOS 27 values bundled inliquid-glass. - Liquid Glass Tooltip: Shares the
menuglass 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:
ChartLegendContentuses circular color dots and secondary text that wraps automatically when constrained.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/chartArea Chart
Donut Chart
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
| Prop | Type | Default | Description |
|---|---|---|---|
config | ChartConfig | — | Defines label, icon, and color (or theme for light/dark) per data key, generating --color-<key> CSS variables |
initialDimension | { width: number; height: number } | 320 × 200 | Fallback dimensions prior to initial layout measurement |
ChartTooltipContent
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Liquid Glass material reacting to glass tint; false renders a 100% opaque surface |
indicator | 'dot' | 'line' | 'dashed' | 'dot' | Series indicator style |
hideLabel | boolean | false | Hide the tooltip title row |
hideIndicator | boolean | false | Hide series color indicators |
nameKey / labelKey | string | — | Data keys used for series name and tooltip label |
ChartLegendContent
| Prop | Type | Default | Description |
|---|---|---|---|
hideIcon | boolean | false | Hide custom icons from config and show color dots instead |
nameKey | string | — | Data key used for legend item labels |
Carousel
Embla-powered carousel with circular Apple 27 Liquid Glass navigation buttons (glass secondary) by default, supporting horizontal and vertical orientations.
Checkbox
Responsive Apple Liquid Glass checkbox with unified rounded-square semantics across platforms (square for multi-select, circle for radio), larger mobile touch targets, macOS 27 desktop precision, indeterminate state, orthogonal glass, and spring check animation.