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

Bar list

Pro

A ranked list of rows, each a label, a bar for its share and its number, sorted by that number, for React and Tailwind CSS. Part of Goop Pro.

Switch the rows (pages that open, plans in euros, teams in their hues, long paths, a zero and a fall, none), how many it shows (the rest counted in "+N more"), the order and the holder: the bars grow in and rescale. The pages, plans, teams and numbers are ours; the page links go nowhere.

When to use

  • A ranked list of rows, each a label, a bar for its share and its number, sorted by that number.

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 Bar list 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-bar-list.json --yes
PROMPT
Add the Goop Bar list to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { BarList, BarListItem } from '@/components/ui/goop/bar-list';
import { Card } from '@/components/ui/goop/card';

<>
  <Card>
    <BarList
      aria-label="Revenue by plan"
      items={[
        { label: 'Business', value: 26100 },
        { label: 'Team', value: 18400 },
        { label: 'Starter', value: 7350 },
        { label: 'Hobby', value: 940 },
      ]}
      format={{ style: 'currency', currency: 'EUR', maximumFractionDigits: 0 }}
      limit={3}
    />
  </Card>
  <BarList aria-label="Top pages" hue="blue">
    <BarListItem label="Pricing" value={1480} asChild>
      <RouterLink href="/pages/pricing" />
    </BarListItem>
    <BarListItem label="Documentation" value={960} asChild>
      <RouterLink href="/pages/docs" />
    </BarListItem>
  </BarList>
</>
  • Fits: overview (its recipe).
  • Also known as: RankedList, TopList, HorizontalBarChart, Leaderboard.
  • A bar list has no frame or inset of its own past its rows' 8 px: in a Card set it in the card's content under the CardHeader, never as a chart in a ChartContainer (that is for plotted series).
  • height, width, padding, gap, corner, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
items?readonly BarListDatum[]The rows as data; or write them as BarListItem children.
children?ReactNodeThe rows as BarListItems (a router's links through asChild), read as the data is.
max?numberThe value a full bar stands for; by default the largest value.
sort?'desc' | 'asc' | false = 'desc'The rows' order: largest first (desc, the default), smallest first (asc), or as given (false).
limit?numberHow many rows to show; the rest are counted in a quiet "+N more" line.
more?ReactNode | ((hidden: number) => ReactNode)The line for the rows limit leaves out, in place of "+N more": its words, or a function of their count.
format?((value: number) => string) | Intl.NumberFormatOptionsHow a figure reads: a function of the value, or Intl.NumberFormat options; by default the reader's own format.
locale?stringThe numbers' locale; the document's language by default.
hue?Exclude<Hue, 'orange' | 'pink'>Every bar's colour (a row's own hue wins): a hue, as a row's; by default the neutral grey.
empty?ReactNode = 'No data to show.'The words of the small empty state shown when there are no rows.
  • Types: BarListDatum = { label: string; value: number; href?: string; icon?: IconName; hue?: Exclude<Hue, 'orange' | 'pink'>; id?: string }
Parts
PartWhat it is
BarListItemOne row of a BarList; takes asChild; label: ReactNode — What the row counts, at its start; value: number — Its number: the list scales and sorts by it, and writes it at the row's end in its format; icon?: IconName — A pack icon before the label, by its name; hue?: Exclude<Hue, 'orange' | 'pink'> — The bar's colour, over the list's: a hue (blue, green, yellow, red, the accent primary, the grey neutral); href?: string | undefined — The row's link: the whole row opens it; children?: ReactElement — The caller's link element (with no children of its own)
  • data-slot values (to select a part by): bar-list, bar-list-footer, bar-list-icon, bar-list-indicator, bar-list-item, bar-list-label, bar-list-list, bar-list-row, bar-list-track, bar-list-value

Keyboard

KeyWhat it does
TabMove to the next linked row
EnterOpen the focused row's link

Accessibility

  • The part itself answers the keys above.
  • hover, active: the browser's own (:hover, :active): write nothing

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/bar-list.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-bar-list.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.