npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-chart-bar.json --yesChart bar
ProA bar chart of amounts by category or period, side by side or stacked, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
import { ChartBar } from '@/components/ui/goop/chart-bar';
function VisitsThisWeek() {
return (
<ChartBar
title="Site visits"
description="This week, by day"
summary="Site visits each day this week: Tuesday had the most."
config={{ visits: { label: 'Visits' } }}
categoryKey="day"
unit="visits"
readout={{ label: 'Daily average', value: 'average', detail: 'against last week', change: 0.08 }}
data={[
{ day: 'Mon', visits: 12 },
{ day: 'Tue', visits: 19 },
{ day: 'Wed', visits: 15 },
{ day: 'Thu', visits: 17 },
{ day: 'Fri', visits: 9 },
]}
/>
);
}Point at a bar (or Tab to the plot and use the arrows) and the headline follows it; switch grouped or stacked, the average line, the readout, the look (one series, two grouped, a change below zero), the legend beside, loading. The numbers are ours.
When to use
- A bar chart of amounts by category or period, side by side or stacked.
- Also called: bar graph.
When not to use
- A flow in and out over time is stacked, the outflow negative.
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 bar 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-bar.json --yesAdd the Goop Chart bar to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ChartBar } from '@/components/ui/goop/chart-bar';
function VisitsThisWeek() {
return (
<ChartBar
title="Site visits"
description="This week, by day"
summary="Site visits each day this week: Tuesday had the most."
config={{ visits: { label: 'Visits' } }}
categoryKey="day"
unit="visits"
readout={{ label: 'Daily average', value: 'average', detail: 'against last week', change: 0.08 }}
data={[
{ day: 'Mon', visits: 12 },
{ day: 'Tue', visits: 19 },
{ day: 'Wed', visits: 15 },
{ day: 'Thu', visits: 17 },
{ day: 'Fri', visits: 9 },
]}
/>
);
}- height, width, gap, background, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| variant | default | stacked = 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. |
| average? | boolean | The dashed average line, its value in the end gutter: on by default with a readout. |
| averageLabel? | string = 'Avg' | The word before the average's value. |
| 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-bar, chart-bar-average, chart-bar-average-digit, chart-bar-average-value, chart-bar-cursor, chart-bar-edge, chart-bar-item, chart-bar-leaving, chart-bar-value
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.