Banner

A full-bleed announcement bar for promos, release notes and site-wide notices. Soft tones tint the background, message, icon and action from one semantic token, so the whole bar reads as a single hue.

New: cream and moonlight themes just landed.Check it out

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Add this component (its dependencies come along)npx koalaui-cli@latest add banner

Usage#

usage.tsxTSX
import {  Banner,  BannerIcon,  BannerContent,  BannerAction,} from "@/components/ui/banner"export function Example() {  return (    <Banner variant="purple" dismissible>      <BannerIcon>        <Megaphone />      </BannerIcon>      <BannerContent>New: cream and moonlight themes just landed.</BannerContent>      <BannerAction href="#">Check it out</BannerAction>    </Banner>  )}

Variants#

Soft tones tint the background from a single semantic token and color the icon, action, and message to match. The message takes a deep, tone-tinted ink (a dark blue, dark purple, ...) on light themes and lifts to a bright tint on dark ones, so it stays readable while the icon and action keep the pure hue. Every tone re-themes across light, dark, cream, and moonlight.

Koala UI v1.0 is here.Read the release notes
Introducing the new AI components.Explore
Scheduled maintenance this Sunday at 02:00 UTC.Status page
Your account has been upgraded to Pro.View benefits
Your trial ends in 3 days.Upgrade now
We refreshed our docs. Take a look around.What's new

Solid#

Set appearance="solid" for a filled bar. Solid is designed for two theme-stable surfaces: the default inverse bar (flips with the theme) and the brand accent bar. The soft tones stay tinted because the hue tokens shift lightness per theme.

Black Friday: 40% off all plans this week.Get the deal
Koala UI v1.0 is live.See what's new

Festive#

Set appearance="festive" for a playful celebration bar: a flat, saturated fill behind white text, the natural home for launches, milestones, and holidays. It ignores the tone variant. Recolor the bar by overriding one CSS variable, --banner-festive-via, with a brand or flag color. Keep it deep and saturated so the white text stays legible across every theme.

We just shipped v1.0. Thanks for celebrating with us.See what's new
Drive the bar with your own color.Join the celebration

Interactive (confetti)#

Add confetti to a festive bar to make it playful: it bursts once on mount and again on every click. The icon pops on the mount burst only, so clicking showers confetti while the icon stays still. The pieces are themed by the --banner-confetti-* tokens, which derive from the festive palette, so they re-tint with it (recolor the bar and the confetti follows). It is decorative and fully honors reduced-motion. Click the bars below.

We just crossed 9,000 stars. Tap to celebrate!Star the repo
Drive the bar and the confetti with your own colors.Join in

Ornaments#

Drop a BannerOrnament in to peek a decorative flag, mascot, or emoji in from an edge. It clips to the bar and sits behind the message, tilting away from its side. Below, two Venezuela flags (rounded 16px, not circular) peek from the corners of a flat solid bar, with the confetti tinted to the flag's yellow and red. The flag itself is any element you like, sized and rounded however you want.

We're celebrating with Venezuela today.Get full access

Alignment#

The default align="center" centers the message. Switch to align="between" to pin the message left and the action right, the natural home for a Button CTA.

You have 14 days left in your free trial.Upgrade
Try the new AI components, free during beta.Get a demo

Shape#

shape sets the bar's footprint. The default "bar" runs edge to edge, the classic strip atop a page. "inset" draws the same bar as a rounded card that sits inside the page gutter, above the navbar: place it in a SectionContainer (or any gutter) and it takes that width, its inner row trading the page-width cap for a card interior and a step more height.

Koala UI now available for Mobile Apps!Check it out

Dismissible#

Set dismissible to render a trailing close button. Uncontrolled by default (the banner hides itself); pass open / onOpenChange to control it, and always give a descriptive dismissLabel.

New: cream and moonlight themes just landed.Check it out

As child action#

Use asChild on BannerAction to render the link styles onto a framework link (e.g. Next.js <Link>) via Radix Slot, keeping client-side navigation.

Read the v1.0 changelog.See what's new

API reference#

PropTypeDefaultDescription
variantdefault | brand | purple | pink | teal | orange | info | success | warning | destructivedefaultTone of the bar.
appearancesoft | solid | festivesoftFill style. solid supports default (inverse) and brand; festive is a flat celebration bar themed by the --banner-festive-via var.
aligncenter | betweencenterCentered message, or message-left / action-right.
shapebar | insetbarEdge-to-edge strip, or a rounded card inside the page gutter.
dismissiblebooleanfalseRender a trailing close button.
confettibooleanfalseBurst confetti on mount and on click (pairs with festive); honors reduced-motion.
openboolean-Controlled visibility.
defaultOpenbooleantrueUncontrolled initial visibility.
onOpenChange(open: boolean) => void-Fires when dismissed.
dismissLabelstringDismissAccessible label for the close button.
classNamestring-Merged onto the root, last.

Parts: Banner, BannerIcon, BannerContent, BannerAction (accepts asChild), and BannerOrnament (decorative edge peek, takes side). Each forwards its native props and merges className last.

FAQ#

Banner is a site-wide, full-bleed announcement bar - promos, release notes, maintenance notices - typically pinned above the navbar. Alert is an inline, in-page status message scoped to a section or form. If it spans the whole viewport width and speaks for the whole site, it's a Banner.