Banner

Pro

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# Activate your Pro license (once per machine)npx koalaui-cli@latest login <key># Add this component (its dependencies come along)npx koalaui-cli@latest add banner

Usage#

This example is part of Koala UI Pro

The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.

Have a license? Unlock it here

Anatomy#

import {  Banner,  BannerOrnament,  BannerIcon,  BannerContent,  BannerAction,} from "@/components/ui/banner"<Banner>  <BannerOrnament />  <BannerIcon />  <BannerContent />  <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

Size#

size sets the strip's own height and side padding."md" (default) is the page bar, with the 24px page gutter."sm" is a compact strip for a panel, a tablet screen or the head of a card: 12px sides, a 32px row, the type a step down and a smaller close button, and no page-width cap. Use it instead of reaching into the inner row with selectors.

Radio channel 3 is down. Use channel 5.Switch
Shift change at 21:00.

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#

Banner

The full-bleed bar. Children land in an inner row; the close button and confetti layer are drawn for you. Forwards all native <div> props. Every part accepts className, merged last.

PropTypeDefaultDescription
variant"default" | "brand" | "purple" | "pink" | "teal" | "orange" | "info" | "success" | "warning" | "destructive""default"The tone. The icon, message and action all carry it.
appearance"soft" | "solid" | "festive""soft"The fill. solid is defined for default (inverse) and brand; festive is a flat celebration bar that ignores the tone.
align"center" | "between""center"A centered message, or message left and action right (stacked on phones).
shape"bar" | "inset""bar"An edge-to-edge strip, or a rounded card inside the page gutter.
size"md" | "sm""md"The page bar (24px sides), or a compact strip (12px sides, 32px row, smaller type and close, no page-width cap) for panels and cards.
dismissiblebooleanfalseRenders a trailing close button.
dismissLabelstring"Dismiss"The accessible label of the close button.
openboolean-Visibility, controlled. A closed banner renders nothing.
defaultOpenbooleantrueVisibility on first render, uncontrolled.
onOpenChange(open: boolean) => void-Called when the banner is dismissed.
confettibooleanfalseA burst on mount (with an icon pop) and on every click of the bar. Pairs with festive; off under reduced motion.
CSS variableDescription
--banner-festive-viaThe fill of the festive bar. Override it on the banner or a parent; keep it deep enough for white text.
--banner-festive-toA confetti accent alongside the festive fill.
--banner-confetti-{1,2,3}The three confetti colors, derived from the festive stops by default.
--surfaceSet to the fill of the bar, so a nested control blends with it.

BannerIcon

The leading icon, tinted to the tone. Forwards all native <span> props.

BannerContent

The message, a deep tint of the tone. Forwards all native <span> props.

BannerAction

The inline call-to-action link, tinted to the tone. Forwards all native <a> props.

PropTypeDefaultDescription
asChildbooleanfalseRenders onto its single child (Radix Slot), such as a Next.js <Link>.

BannerOrnament

A decorative flag, mascot or emoji that peeks in from an edge behind the message, clipped to the bar and aria-hidden. Forwards all native <span> props.

PropTypeDefaultDescription
side"left" | "right""left"The edge it peeks in from; it tilts away from that edge.
Data attributeDescription
data-side"left" or "right".

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.