Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-chart-line.json --yes

Chart line

Pro

A 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.

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

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-chart-line.json --yes
PROMPT
Add the Goop Chart line to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { ChartLine } from '@/components/ui/goop/chart-line';

<ChartLine
  variant="area"
  title="Interviews by day"
  description="This week"
  summary="Interviews recorded each day: Thursday had the most, Friday the fewest."
  config={{ recorded: { label: 'This week' }, before: { label: 'Last week', dashed: true } }}
  categoryKey="day"
  unit="interviews"
  readout={{ label: 'This week', value: 'total', compare: 'last week' }}
  data={[
    { day: 'Mon', recorded: 6, before: 4 },
    { day: 'Tue', recorded: 9, before: 7 },
    { day: 'Wed', recorded: 7, before: 8 },
    { day: 'Thu', recorded: 11, before: 6 },
    { day: 'Fri', recorded: 3, before: 6 },
  ]}
/>
  • Fits: overview (its recipe).
  • motion: add no class for these.

API reference

Options
OptionTypeWhat it does
variantdefault | area = default
configNoInfer<ChartConfig<ChartKey<Data>>>The series, in order, each keyed by a field of the rows: its label, and dashed if wanted.
dataDataThe rows, in the category axis's order: of the caller's own type (an interface too) or ChartRow.
categoryKeyNoInfer<ChartKey<Data>>The field of each row that holds its category.
Defaultsencode = 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

KeyWhat it does
TabFocus the plot
ArrowLeftMove the active point one category
ArrowRightMove the active point one category
ArrowUpMove the active point to the next category
ArrowDownMove the active point to the previous category
PageUpMove the active point seven categories on
PageDownMove the active point seven categories back
HomeMove the active point to the first category
EndMove the active point to the last category
EscapePut 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.
  • How the theme moves, and how to move your own parts the same way: Motion.

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.

goop.so/themes/trail/components/chart-line.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-chart-line.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.