Skip to Content

Banner

Dismissible announcement bar for the top of a page: start and centered variants, a background slot for art, a link that becomes a full-bar tap target on phones, and a dismiss button that hands focus onward.

pnpm dlx shadcn add @01orbital/banner

Usage

import {
  Banner,
  BannerContent,
  BannerDismiss,
  BannerLink,
} from "@/components/banner/banner"

// The copy: change text here, not in the markup.
const COPY = {
  message: "Version 2 ships on Monday with eleven new blocks.",
  link: "See what's new",
  dismiss: "Dismiss announcement",
} as const

/** A dismissible Banner: one line of text, a link and the dismiss button. */
export default function BannerDemo() {
  return (
    <Banner className="bg-primary text-primary-foreground">
      <BannerContent>
        <p>{COPY.message}</p>
      </BannerContent>
      <BannerLink href="#">{COPY.link}</BannerLink>
      <BannerDismiss aria-label={COPY.dismiss} />
    </Banner>
  )
}

Examples

New

banner-museum-notice

banner-museum-notice

Museum Notice

Example of the Banner component on a museum visit page, opened by a dismissible notice with paper grain behind the text.

pnpm dlx shadcn add @01orbital/banner-museum-notice

New

banner-exhibition

banner-exhibition

Exhibition

Example of the Banner component: an announcement strip above a sparse exhibition poster layout.

pnpm dlx shadcn add @01orbital/banner-exhibition

New

banner-bookshop

banner-bookshop

Bookshop

Example of the Banner component: a centered notice inside a double rule above an understated bookshop masthead.

pnpm dlx shadcn add @01orbital/banner-bookshop

New

banner-release-bulletin

banner-release-bulletin

Release Bulletin

Example of the Banner component as a release bulletin: a status mark beside the notice, with a textured background slot behind it.

pnpm dlx shadcn add @01orbital/banner-release-bulletin

banner-blue-glow-line

banner-blue-glow-line

Blue Glow Line

Banner example: dark centered launch announcement banner for SaaS on a cool near-black ground, with a blue glow line lighting its bottom edge, an arrow link and a dismiss button. Shorter copy on phones.

pnpm dlx shadcn add @01orbital/banner-blue-glow-line

banner-neoconstruct-event

banner-neoconstruct-event

Neoconstruct Event

Banner example: retro constructivist event banner on cream paper with a hard ink rule below: a red ribbon badge for seats left, a workshop notice and a small call to action button with an arrow and offset shadow.

pnpm dlx shadcn add @01orbital/banner-neoconstruct-event

banner-new-feature-badge

banner-new-feature-badge

New Feature Badge

Banner example: product update announcement banner in the accent color: a New badge before the message, an arrow link to the feature and a dismiss button. A shorter line swaps in on small screens.

pnpm dlx shadcn add @01orbital/banner-new-feature-badge

banner-archived-workspace

banner-archived-workspace

Archived Workspace

Banner example: status bar banner for an archived workspace or admin dashboard: a sidebar-toned strip with an archive icon, a wrapping message beside an outline restore button link, and a dismiss control. Sits above the app shell.

pnpm dlx shadcn add @01orbital/banner-archived-workspace

banner-gradient-live-event

banner-gradient-live-event

Gradient Live Event

Banner example: centered live event banner for a webinar or livestream: a page-colored strip washed with a faint colorful gradient across the chart colors, with a join link and dismiss button.

pnpm dlx shadcn add @01orbital/banner-gradient-live-event

banner-raised-referral

banner-raised-referral

Raised Referral

Banner example: referral program promo banner, start-aligned on a raised surface with a top highlight and soft drop shadow lifting it off the page, plus an invite friends link and dismiss button.

pnpm dlx shadcn add @01orbital/banner-raised-referral

banner-shaded-url-change

banner-shaded-url-change

Shaded Url Change

Banner example: migration notice bar for docs and devtools: a start-aligned panel shading toward its foot, announcing a moved URL with a config link. Copy shortens on small screens.

pnpm dlx shadcn add @01orbital/banner-shaded-url-change

banner-corner-sheen

banner-corner-sheen

Corner Sheen

Banner example: release notes announcement banner, centered on a card-colored bar with a sheen of light spilling from the top-left corner, one short line of version news, a what-changed link and a dismiss button.

pnpm dlx shadcn add @01orbital/banner-corner-sheen

banner-dark-paper-texture

banner-dark-paper-texture

Dark Paper Texture

Banner example: dark pre-order announcement banner with a paper texture: a charcoal gradient with printed grain over the content, one line of editorial copy and a pre-order link. Dark mode is scoped to the banner itself.

pnpm dlx shadcn add @01orbital/banner-dark-paper-texture

banner-dark-glow-seam

banner-dark-glow-seam

Dark Glow Seam

Banner example: dark documentation announcement banner with a glowing light seam along its bottom edge, a guide link and a dismiss button. The dark scope keeps it consistent on any page.

pnpm dlx shadcn add @01orbital/banner-dark-glow-seam

banner-muted-release

banner-muted-release

Muted Release

Banner example: minimal centered announcement bar on a muted ground for release notes: a short message, an arrow link and a dismiss button. A shorter line replaces the message on small screens.

pnpm dlx shadcn add @01orbital/banner-muted-release

banner-maintenance-notice

banner-maintenance-notice

Maintenance Notice

Banner example: minimal start-aligned maintenance notice for system status and downtime: a card-colored bar with a bottom border, a clock icon hidden on phones, a status-page link and a dismiss button.

pnpm dlx shadcn add @01orbital/banner-maintenance-notice

banner-primary-color

banner-primary-color

Primary Color

Banner example: minimal promo announcement bar filled with the primary brand color and matching text, with an arrow link and a dismiss button. The message shortens on small screens.

pnpm dlx shadcn add @01orbital/banner-primary-color

banner-billing-warning

banner-billing-warning

Billing Warning

Banner example: minimal billing warning alert bar with a faint red destructive tint, red text and a bottom border, carrying a payment failed message, an update link and dismiss. The tint deepens in dark mode.

pnpm dlx shadcn add @01orbital/banner-billing-warning

Anatomy

Banner is built from 5 parts. In the example they nest like this:

Banner
├─ BannerContent
├─ BannerLink
└─ BannerDismiss

API reference

Banner

A thin announcement bar. The text steps from 13px to 14px and the message wraps on screens 40rem and wider (sm:), and below that the link label hides. The side padding grows at the lg screen width.

Prop

Type

It also accepts the HTML attributes of the element it renders.

BannerContent

It accepts the HTML attributes of the element it renders.

Prop

Type

It also accepts the HTML attributes of the element it renders.

BannerDismiss

Prop

Type

It also accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.

BannerBackground

It accepts the HTML attributes of the element it renders.

Dependencies

npm: @phosphor-icons/react, class-variance-authority, cn. The CLI installs them for you.

Registry pieces it installs with it: