Tessera UI

Alert

Contextual feedback messages for user actions or system events. Four visual variants (solid, soft, outline, ghost), five intents, three sizes, six rounded options, optional close button, actions, and RTL support.

Installation

pnpm add @tessinaui/ui

Usage

import { Alert } from "@tessinaui/ui";

<Alert
  intent="error"
  title="Something went wrong"
  description="There was an issue processing your request. Please try again."
  onClose={() => {}}
/>

Playground

Preview

Showcase

Preview

Variants

VariantDescription
solidFilled background using the full intent colour — bg-error, bg-warning, etc. High emphasis.
softLight tinted background (bg-error-light) with semantic icon colour. Default.
outlineColoured border + very subtle tint. No background fill on the text area.
ghostNo background or border. Icon still carries the semantic colour. Minimal emphasis.

Intents

IntentIconUse case
noneInfoNeutral informational message
errorCircleXDestructive action failed, validation error
warningTriangleAlertPotentially harmful, requires attention
successCircleCheckAction completed successfully
infoInfoNon-critical information or guidance

Props

Alert

PropTypeDefaultDescription
intent"none" | "error" | "warning" | "success" | "info""none"Semantic colour and default icon
variant"solid" | "soft" | "outline" | "ghost""soft"Visual fill style
size"sm" | "md" | "lg""md"Text size and padding
rounded"none" | "sm" | "md" | "lg" | "xl" | "full""md"Border radius
width"narrow" | "default" | "wide""default"Max-width constraint — narrow (sm), default (full), wide (4xl)
titleReactNodeBold heading text
descriptionReactNodeSupporting body text
iconReactNodeIntent defaultCustom leading icon
showIconbooleantrueShow or hide the leading icon
onClose() => voidRenders a dismiss (×) button when provided
actionAlertActionPrimary CTA on the trailing edge
secondaryActionAlertActionSecondary CTA beside the primary
shadowbooleanfalseDrop shadow — use for callout / floating card style
dir"ltr" | "rtl""ltr"Text direction
rolestring"alert"ARIA live-region role. Use "status" for non-urgent messages
classNamestringExtra classes on the root element

AlertAction

FieldTypeDescription
labelstringButton text
onClick() => voidClick handler
variantButtonProps["variant"]Override button fill style
intentButtonProps["intent"]Override button intent colour
roundedButtonProps["rounded"]Override button radius. Default: "full"
disabledbooleanDisabled state
loadingbooleanLoading spinner state
leadingIconReactNodeIcon before label
trailingIconReactNodeIcon after label

Accessibility

  • Root element carries role="alert" by default — an assertive ARIA live region. Set role="status" for non-urgent (polite) announcements.
  • The leading icon uses aria-hidden="true" — it is decorative; the title and/or description provide the text.
  • The close button has an accessible aria-label="Dismiss".
  • All interactive elements (action buttons, close) meet the WCAG AA 44×44 px minimum touch target via Tessera's Button/IconButton components.
  • Focus ring: focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2.

On this page