Alert
Displays a callout for user attention with customizable variants.
Preview
A preview of the Alert component with interactive controls.
Interactive
Installation
Add the Alert component to your project.
ng g @ng-cn/core:c alertUsage
Import and use the Alert component in your Angular application.
<Alert>
<lucide-icon name="terminal" class="h-4 w-4" />
<AlertTitle>Heads up!</AlertTitle>
<AlertDescription>
You can add components to your app using the CLI.
</AlertDescription>
</Alert>Examples
Explore different variations and use cases for the Alert component.
Default
A default alert with an icon and descriptive text.
Interactive
Destructive
Use the destructive variant for error messages or warnings.
Interactive
With Custom Icon
Alerts can include any Lucide icon to match the context.
Interactive
API Reference
Props | Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'destructive' | 'default' | The visual style of the alert. |
class | string | — | Additional CSS classes to apply. |