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
import { Banner } from "@/components/ui/banner";<Banner href="#">Version 2 is out.</Banner>Installation
$ pnpm dlx shadcn@latest add @synccn/bannerFirst 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
stringAdds a link after the message.
- linkLabel
stringDefault
"Learn more"Text for the link.
- variant
"default" | "muted" | "gradient"Default
"default"Background style.
- dismissible
booleanDefault
trueShows a close button.
- onDismiss
() => voidCalled after the banner is closed.
- children
React.ReactNodeContent to render.
- className
stringExtra 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
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for ArrowRight, X
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