Alert

Inline semantic feedback surface with status variants.

Add it to your project

Eject the complete alert group, then import from its generated local barrel. The copied source and CSS belong to your application.

bash
pnpm exec toucan eject alert
app.tsx
import { Alert } from '@/components/toucan/alert';

Use when

A message needs persistent contextual emphasis near relevant content.

Avoid when

The message is transient and global; use Toast.

Example

This is an informational message.

Success

Your changes have been saved.

Alert with custom colors via surface props.

API reference

Generated from packages/react/src/components. Only Toucan-specific props are listed; forwarded native props remain available as noted for each export.

Alert

Alert

Props type: AlertProps

NameTypeDefaultRequiredDescription
borderstringundefinedNoCustom CSS colour for the border when using the custom variant.
onSurfacestringundefinedNoCustom CSS colour for content when using the custom variant.
surfacestringundefinedNoCustom CSS background colour when using the custom variant.
variant"info" | "success" | "warning" | "danger" | "custom"'info'NoSemantic visual variant.

Also accepts the native div attributes that are not replaced by a Toucan prop.

Type exports

AlertProps

Accessibility

  • Warning and danger variants default to alert; other variants default to status.

Token families

alertcolor

Related components