Skip to content

Banner

<ts-banner> vv0.4.0

The ts-banner component.

Open in Storybook for interactive demos.

<ts-banner variant="info">Content</ts-banner>
PropertyAttributeTypeDefaultDescription
dismissibledismissiblebooleanfalseWhether the banner can be dismissed.
iconiconstring | undefinedOptional Lucide icon name.
stickystickybooleanfalseWhether the banner sticks to the top of the viewport.
variantvariant"danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning"'info'The banner’s semantic variant.
EventDetailBubblesComposedDescription
tsClosevoidYesYesEmitted when the banner is dismissed.
MethodSignatureDescription
closeclose() => Promise<void>Programmatically close the banner.
showshow() => Promise<void>Programmatically show the banner.
NameDescription
*(default)*Default slot for message content.
actionCTA button.

Use ::part() to style internal elements:

PartDescription
actionThe action slot wrapper.
baseThe banner container.
closeThe close/dismiss button.
iconThe icon wrapper.
messageThe message wrapper.
ts-banner::part(action) {
/* your custom styles */
}
<ts-banner variant="info">Content</ts-banner>
import { TsBanner } from '@tessera-ui/react';
<TsBanner variant="info">Content</TsBanner>