structyl

Alert

stable

Displays a callout for user attention.

Basic usage

Examples

All variants

Five semantic variants to cover every notification context.

Alert variants

Use semantic variants for success, warning, info and destructive states.

Filled alerts with color prop

Add filled and color props together for solid-background alert styles.

Features

  • Five variants: default, destructive, success, warning, info.

Installation

bash
pnpm dlx structyl add alert

API Reference

Alert.Root

The alert container. Has role="alert".

PropTypeDefault
variant'default' | 'destructive' | 'success' | 'warning' | 'info'

Visual style.

'default'
classNamestring

Additional Tailwind classes, merged with the component defaults.

Alert.Title

The alert heading.

PropTypeDefault
classNamestring

Additional Tailwind classes, merged with the component defaults.

Alert.Description

The alert body text.

PropTypeDefault
classNamestring

Additional Tailwind classes, merged with the component defaults.

Alert | structyl