npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-banner.json --yesBanner
ProA full-width accent pill that announces one thing, such as an app to install or a feature to switch on, with one action at its end, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- BannerIconThe pack icon at the start, 18 px (12 px in the announcement), in the pill's ink (on a status kind the kind's role)
- BannerTitleThe announcement's words
- BannerDescriptionThe message, after the title
- BannerActionThe one action at the pill's end, 12 px before the close
import { useState } from 'react';
import { Banner, BannerAction, BannerDescription, BannerIcon, BannerTitle } from '@/components/ui/goop/banner';
function DesktopAppBanner({ onDownload }: { onDownload: () => void }) {
const [open, setOpen] = useState(true);
return (
<div className="flex flex-col items-start gap-3">
<Banner variant="warning" open={open} onDismiss={() => setOpen(false)}>
<BannerIcon />
<BannerTitle>Two visits have no crew</BannerTitle>
<BannerDescription>Assign one before Monday.</BannerDescription>
</Banner>
<Banner variant="announcement" asChild>
<a href="/changelog">
<BannerIcon icon="grip" />
<BannerTitle>New: plan visits on a map</BannerTitle>
</a>
</Banner>
<Banner>
<BannerIcon icon="tabler-outline:device-laptop" />
<BannerTitle>Get the desktop app to record your site visits</BannerTitle>
<BannerAction onClick={onDownload}>Download</BannerAction>
</Banner>
</div>
);
}When to use
- A full-width accent pill that announces one thing, such as an app to install or a feature to switch on, with one action at its end.
- Also called: announcement bar.
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 Banner 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-banner.json --yesAdd the Goop Banner to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { useState } from 'react';
import { Banner, BannerAction, BannerDescription, BannerIcon, BannerTitle } from '@/components/ui/goop/banner';
function DesktopAppBanner({ onDownload }: { onDownload: () => void }) {
const [open, setOpen] = useState(true);
return (
<div className="flex flex-col items-start gap-3">
<Banner variant="warning" open={open} onDismiss={() => setOpen(false)}>
<BannerIcon />
<BannerTitle>Two visits have no crew</BannerTitle>
<BannerDescription>Assign one before Monday.</BannerDescription>
</Banner>
<Banner variant="announcement" asChild>
<a href="/changelog">
<BannerIcon icon="grip" />
<BannerTitle>New: plan visits on a map</BannerTitle>
</a>
</Banner>
<Banner>
<BannerIcon icon="tabler-outline:device-laptop" />
<BannerTitle>Get the desktop app to record your site visits</BannerTitle>
<BannerAction onClick={onDownload}>Download</BannerAction>
</Banner>
</div>
);
}- Fits: overview, settings: header.
- One banner at a time, at the top of the page or the settings section it concerns, above its first heading. A message about one section or record is an alert in the page; the result of something the person just did is a
Toast. - height, width, padding, gap, corner, border, background, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| variant? | 'primary' | 'default' | 'info' | 'success' | 'warning' | 'destructive' | 'announcement' = 'primary' | primary (the default): the full-width blue pill with its one action; default, info, success, warning or destructive: the same pill, quiet, in the kind's status tint, its icon the kind's own. Or: announcement: the small pill that is itself the one control (a button, or your link with asChild). |
| asChild? | boolean = false | Draw the announcement on its one child element (a link) instead of a button; its parts go inside it. |
| open? | boolean | Whether the banner is shown (shown when left out); false takes it off the page at once, true brings it back. |
| onDismiss? | () => void | Called when the close is pressed; given, the full-width pill draws the close. |
| dismissLabel? | string = 'Dismiss' | The close's spoken name, before the title's words: "Dismiss" unless given. |
| Part | What it is |
|---|---|
| BannerIcon | The pack icon at the start, 18 px (12 px in the announcement), in the pill's ink (on a status kind the kind's role); decorative, the words say what it is about; icon?: IconName — A pack icon name, of the theme's main pack or its second (tabler-outline:<name>) |
| BannerTitle | The announcement's words |
| BannerDescription | The message, after the title |
| BannerAction | The one action at the pill's end, 12 px before the close; takes asChild; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean |
- data-slot values (to select a part by): banner, banner-action, banner-close, banner-content, banner-description, banner-icon, banner-title, banner-words
Keyboard
| Key | What it does |
|---|---|
| Enter Space | On the action: run it |
Accessibility
- The native element answers the keyboard.
- hover, active: the browser's own (:hover, :active): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| disabled | the prop disabled |
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.