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

Banner

Pro

A full-width band across the top of the app or a page for one message that stays until it is no longer true, such as a trial ending, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • A full-width band across the top of the app or a page for one message that stays until it is no longer true, such as a trial ending.
  • 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.

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

Usage

TSX
import { Banner, BannerIcon, BannerTitle, BannerDescription, BannerAction } from '@/components/ui/goop/banner';
import { useState, useEffect } from 'react';
import { AppFrame, AppFramePanel } from '@/components/goop/patterns/app-frame';
import { Button } from '@/components/ui/goop/button';
import { TopBar, TopBarRow, TopBarGroup, TopBarTitle } from '@/components/ui/goop/top-bar';

function TrialBanner() {
  const [shown, setShown] = useState(true);
  useEffect(() => {
    if (sessionStorage.getItem('banner:trial-ends') !== null) setShown(false);
  }, []);
  return (
    <AppFrame>
      <AppFramePanel
        header={
          <>
            <Banner
              open={shown}
              variant="warning"
              onDismiss={() => {
                sessionStorage.setItem('banner:trial-ends', 'closed');
                setShown(false);
                document.getElementById('page-title')?.focus();
              }}
            >
              <BannerIcon />
              <BannerTitle>Your trial ends in 3 days</BannerTitle>
              <BannerDescription>Add a payment method to keep your projects.</BannerDescription>
              <BannerAction>
                <Button variant="outline" size="sm">
                  Add payment method
                </Button>
              </BannerAction>
            </Banner>
            <TopBar role="banner">
              <TopBarRow>
                <TopBarGroup>
                  <TopBarTitle id="page-title" tabIndex={-1}>
                    Projects
                  </TopBarTitle>
                </TopBarGroup>
              </TopBarRow>
            </TopBar>
          </>
        }
      >
        <p>Three projects are due this week.</p>
      </AppFramePanel>
    </AppFrame>
  );
}
  • Fits: overview, settings: header.
  • One banner at a time per surface. A message about one section or record is Alert; the result of an action Toast; a choice to make now AlertDialog. In the app: header={<><Banner …/><TopBar role="banner">…</TopBar></>}; in a Card, a Sheet or a Dialog, its first child. Never size it. On primary the action is the outline Button or a Link.
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
variantdefault | info | success | warning | destructive | primary = default
open?booleanWhether the strip is shown (shown when left out).
onDismiss?() => voidCalled when the close is pressed; given, the close is drawn.
dismissLabel?string = 'Dismiss'The close's spoken name, before the title's words: "Dismiss" unless given.
Parts
PartWhat it is
BannerIconThe kind's pack icon, 16 px, at the start, centred on the first line; icon?: IconName — A pack icon name in place of the kind's
BannerTitleThe message's few words, in the medium weight, before the message on the same line; wraps, never cut
BannerDescriptionThe message, after the title on the same line where it fits; shown whole, never cut
BannerActionThe caller's action after the words — the theme's small Button (size="sm"; on primary variant="outline") or its Link — centred on the first line; on a phone under the words
  • Class recipes (cva): bannerVariants (Banner)
  • data-slot values (to select a part by): banner, banner-action, banner-body, banner-content, banner-description, banner-fold, banner-icon, banner-inset, banner-title

Accessibility

  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
expandedthe attribute data-state=open
openthe attribute data-state=open

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