Alert

Displays a callout for user attention.

Deployment complete
Your app has been deployed to production. DNS propagation may take up to 5 minutes.
Build failed
Missing required field 'database_url' in config.toml. Check your environment variables.

Installation

CLI

Install the component using the StarUI CLI:

star add alert

Examples

With Actions

Alerts with buttons for user response — upgrade prompts, storage warnings

Update available

StarUI v0.3.0 includes 4 new components and improved accessibility.

Storage quota at 92%

You've used 4.6 GB of 5 GB. Uploads will be blocked when you reach the limit.

Form Validation

Error summary with a structured list of field-level issues

3 errors in your submission

Please fix the following before continuing:

  • Email address is required
  • Password must be at least 8 characters
  • You must accept the terms of service

Custom Icon Styling

Convey intent by pairing colored icons with the default variant — not built-in variants

Changes saved
Your profile settings have been updated.
API rate limit approaching
You've used 4,800 of 5,000 requests this hour. Throttling begins at the limit.
Scheduled maintenance
Database maintenance is planned for Saturday 2am–4am UTC. Expect brief downtime.

Without Icon

Alert with just a title and description, no icon column

Keyboard shortcut

Press Ctrl+K to open the command palette from anywhere in the app.

API Reference

Props

Prop Type Default Description
variant Literal['default', 'destructive'] 'default' Visual style variant
live bool False When True, sets role='alert' for screen reader live region announcements. Use only for dynamically inserted alerts
cls str '' Additional CSS classes
Component Description
Alert Root container. Uses CSS grid for icon + content layout
AlertTitle Bold single-line heading (clamped with line-clamp-1)
AlertDescription Supporting content — accepts text, paragraphs, lists, or any rich content