Skip to content
synccn

Banner

Announcement bar with a link and dismiss.

Version 3.0 is here with 40 new components.Learn more

We're changing our pricing on March 1.Read the post

Spring sale ends Friday.Save 30%

Playground

Change the props and copy the code. The controls come from the component's TypeScript types.

Version 2 is out.Learn more

Props

variant
import { Banner } from "@/components/ui/banner";<Banner href="#">Version 2 is out.</Banner>

Installation

$ pnpm dlx shadcn@latest add @synccn/banner

First time in this project? Connect synccn with one command.

Usage

import { Banner } from "@/components/ui/banner";<Banner href="/blog">Version 3.0 is here.</Banner>

API reference

Generated from the component's TypeScript types, so it always matches the code.

Banner

Full-width announcement bar with an optional link and dismiss button.

  • href
    string

    Adds a link after the message.

  • linkLabel
    string

    Default "Learn more"

    Text for the link.

  • variant
    "default" | "muted" | "gradient"

    Default "default"

    Background style.

  • dismissible
    boolean

    Default true

    Shows a close button.

  • onDismiss
    () => void

    Called after the banner is closed.

  • children
    React.ReactNode

    Content to render.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: region
  • ARIA attributes: aria-label