Skip to main content

Examples

Interactive Dismissible

The action slot is composable: pass any element and it receives the variant-appropriate link styling via Radix Slot. For a Next.js app, pass a router-aware link instead of a plain anchor, e.g. action={<Link href="/changelog">See what's new</Link>} where Link is imported from next/link.

All Variants

Info Closable

Props

Alert

Displays a contextual feedback message to the user. Supports info, success, warning, error, and neutral variants with a default icon per variant, optional title, description, dismiss button, and an optional composable action slot. Each variant renders a default icon automatically. Pass a custom icon to override, or icon={null} to hide the icon entirely. Only the title and description live inside the role="alert" live region. The icon, action, and close button are rendered outside it so interactive controls are announced and navigated consistently by screen readers.
ReactNode
Composable action slot rendered beneath the description, outside the role="alert" live region. Pass your own element (an <a>, a next/link <Link>, or a <Button>) and it receives the variant-appropriate link styling via the Radix Slot pattern while remaining a real link/button.
boolean
default:"false"
Whether to show the close button.
string
default:"Close alert"
Accessible label for the close button.
ReactNode
Custom icon override. Pass null to hide the icon entirely. Each variant shows a default icon when left undefined.
(() => void)
Callback fired when the close button is clicked.
string
Optional title text displayed in bold above the description.
"info" | "success" | "warning" | "error" | "neutral"
default:"info"
Visual style variant of the alert.

Exported types

Also exported from @fanvue/ui: AlertProps, AlertVariant.
Setup: Installation · Theming