npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-line.json --yesChart line
ProA line or area chart of up to five levels over time, read on hover, press or keyboard, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
import { ChartLine } from '@/components/ui/goop/chart-line';
function NotesThisWeek() {
return (
<ChartLine
variant="area"
title="Notes written"
description="This week"
summary="Notes written each day against last week: Thursday had the most, Friday the fewest."
config={{ written: { label: 'This week' }, before: { label: 'Last week', dashed: true } }}
categoryKey="day"
unit="notes"
readout={{ label: 'This week', value: 'total', compare: 'last week' }}
data={[
{ day: 'Mon', written: 6, before: 4 },
{ day: 'Tue', written: 9, before: 7 },
{ day: 'Wed', written: 7, before: 8 },
{ day: 'Thu', written: 11, before: 6 },
{ day: 'Fri', written: 3, before: 6 },
]}
/>
);
}Point at the plot (or Tab and use the arrows) to move the crosshair; switch line or area, the look (two lines, a day missing, the gap over its body, five series), the dashed comparison, the readout, the labels and markers, the legend beside, loading; hide a series from its legend. The interviews are ours.
When to use
- A line or area chart of up to five levels over time, read on hover, press or keyboard.
- Also called: line graph.
When not to use
- A flow in and out is ChartBar.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Chart line on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-line.json --yesAdd the Goop Chart line to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ChartLine } from '@/components/ui/goop/chart-line';
function NotesThisWeek() {
return (
<ChartLine
variant="area"
title="Notes written"
description="This week"
summary="Notes written each day against last week: Thursday had the most, Friday the fewest."
config={{ written: { label: 'This week' }, before: { label: 'Last week', dashed: true } }}
categoryKey="day"
unit="notes"
readout={{ label: 'This week', value: 'total', compare: 'last week' }}
data={[
{ day: 'Mon', written: 6, before: 4 },
{ day: 'Tue', written: 9, before: 7 },
{ day: 'Wed', written: 7, before: 8 },
{ day: 'Thu', written: 11, before: 6 },
{ day: 'Fri', written: 3, before: 6 },
]}
/>
);
}- motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| variant | default | area = default | |
| config | NoInfer<ChartConfig<ChartKey<Data>>> | The series, in order, each keyed by a field of the rows: its label, and dashed if wanted. |
| data | Data | The rows, in the category axis's order: of the caller's own type (an interface too) or ChartRow. |
| categoryKey | NoInfer<ChartKey<Data>> | The field of each row that holds its category. |
| Defaults | encode = true; otherLabel = 'Other' |
- Takes every prop of ChartContainer but plot, children, scrub, toggles and stack (its page: chart.md)
- data-slot values (to select a part by): chart-line, chart-line-body
Keyboard
| Key | What it does |
|---|---|
| Tab | Focus the plot |
| ArrowLeft | Move the active point one category |
| ArrowRight | Move the active point one category |
| ArrowUp | Move the active point to the next category |
| ArrowDown | Move the active point to the previous category |
| PageUp | Move the active point seven categories on |
| PageDown | Move the active point seven categories back |
| Home | Move the active point to the first category |
| End | Move the active point to the last category |
| Escape | Put the active point to rest |
Accessibility
- The part itself answers the keys above.
Motion
- The part sets its own motion: add no transition or animation of your own.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.