Alert

Displays a callout for user attention with optional title, description, and action.

Loading preview…

Installation

Usage

Use alerts for status messages, warnings, and important callouts.

1<script lang="ts">
2  import CheckCircle2Icon from "@lucide/svelte/icons/check-circle-2";
3  import * as Alert from "~/components/alert";
4</script>
5
6<Alert.Root>
7  <CheckCircle2Icon />
8  <Alert.Title>Success! Your changes have been saved</Alert.Title>
9  <Alert.Description>This is an alert with icon, title and description.</Alert.Description>
10</Alert.Root>

Pass variant="destructive" for error-style callouts. Compose an icon as a direct child of Alert.Root for a leading indicator, and use Alert.Action for a corner action.