Alert
Displays a callout for user attention.
Invoice INV-2041 sent
Acme Corp was emailed a payment link for $4,200.00.
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
import { InfoIcon } from "lucide-react"
export function Demo() {
return (
<Alert>
<InfoIcon className="size-4" />
<AlertTitle>Invoice INV-2041 sent</AlertTitle>
<AlertDescription>Acme Corp was emailed a payment link for $4,200.00.</AlertDescription>
</Alert>
)
}Installation
npm i @dapplelight/signet-uiUsage
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
<Alert>
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>Something worth reading.</AlertDescription>
</Alert>Examples
Destructive
Payment failed
The card ending 4242 was declined. Update it to keep your plan.
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
import { CircleAlertIcon } from "lucide-react"
<Alert variant="destructive">
<CircleAlertIcon className="size-4" />
<AlertTitle>Payment failed</AlertTitle>
<AlertDescription>The card ending 4242 was declined. Update it to keep your plan.</AlertDescription>
</Alert>Warning
Usage at 92%
You have used 9,200 of 10,000 API calls this month.
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
import { AlertTriangleIcon } from "lucide-react"
<Alert variant="warning">
<AlertTriangleIcon className="size-4" />
<AlertTitle>Usage at 92%</AlertTitle>
<AlertDescription>You have used 9,200 of 10,000 API calls this month.</AlertDescription>
</Alert>Without an icon
Scheduled maintenance
Reports will be unavailable on Sunday from 02:00 to 03:00 UTC.
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
<Alert>
<AlertTitle>Scheduled maintenance</AlertTitle>
<AlertDescription>Reports will be unavailable on Sunday from 02:00 to 03:00 UTC.</AlertDescription>
</Alert>Composition
Deploy succeeded
production · 41s · commit 9f3c2e1
Card declined
Ask the customer for another payment method.
import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert"
export function DeployAlerts() {
return (
<div className="grid gap-4">
<Alert>
<AlertTitle>Deploy succeeded</AlertTitle>
<AlertDescription>production · 41s · commit 9f3c2e1</AlertDescription>
</Alert>
<Alert variant="destructive">
<AlertTitle>Card declined</AlertTitle>
<AlertDescription>Ask the customer for another payment method.</AlertDescription>
</Alert>
</div>
)
}API Reference
Alert
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
variant | "default" | "destructive" | "warning" | "default" | No | Colour of the border, background and icon. |
className | string | — | No | Merged last. |
Plus every native <div> attribute. Renders with role="alert". A direct child svg is placed at the start and the text indents past it.
AlertTitle
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
className | string | — | No | Merged last. |
Plus every native <h5> attribute.
AlertDescription
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
className | string | — | No | Merged last. |
Plus every native <div> attribute.