Skip to content
Feedback

Banner

Dismissible full-width announcement / promo bar with a CTA.

Import

tsx
import { Banner } from "@cooud-ui/ui";
bash
npx cooud-ui add banner

Examples

API Reference

Generated from the component's exported types.

BannerProps

Extends Omit<HTMLAttributes<HTMLElement>, "title">, VariantProps<typeof bannerVariants>

PropTypeDefaultDescription
title
ReactNodeHeadline text. Pair with `description`, or omit and pass `children`.
description
ReactNodeOptional secondary line shown after the title.
icon
ReactNodeLeading glyph rendered before the message (e.g. a lucide icon).
action
ReactNodeRight-aligned call to action (a , link, etc.).
dismissible
booleantrueRender a trailing close button. Defaults to `true`.
onDismiss
() => voidFired after the banner is dismissed (controlled or not).
open
booleanControlled visibility. When provided, the component is fully controlled.
defaultOpen
booleantrueInitial visibility for the uncontrolled case. Defaults to `true`.
label
string"Announcement"Accessible label for the announcement region. Defaults to "Announcement".
children
ReactNodeFree-form message body, used when `title`/`description` are not supplied.
variant
"default" | "brand" | "info" | "success" | "warning" | "error""default"
align
"start" | "center""center"