Skip to content

Alert

<ts-alert> vv0.4.0

The ts-alert component.

Open in Storybook for interactive demos.

<ts-alert variant="info">Content</ts-alert>
PropertyAttributeTypeDefaultDescription
closableclosablebooleanfalseWhether the alert can be dismissed.
variantvariant"danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning"'info'The alert’s semantic variant.
EventDetailBubblesComposedDescription
tsClosevoidYesYesEmitted when the alert is closed.
MethodSignatureDescription
closeclose() => Promise<void>Programmatically close the alert.
showshow() => Promise<void>Programmatically show the alert.
NameDescription
*(default)*Default slot for alert message content.
actionAction buttons or links displayed at the end.
iconCustom icon to override the default variant icon.

Use ::part() to style internal elements:

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