ComponentsPrimitives
Alert
An accessible status message with an optional urgent announcement.
Install
npx ghostcn@1.4.0 add alert --skip-existingUsage
The default status region is appropriate for nonurgent updates. Use urgent=true for urgent dynamic announcements, not as a visual variant.
{{> "components/alert" heading="You are all set" description="Your theme is ready to customize."}}Component options
| Parameter | Behavior |
|---|---|
variant | Visual treatment; unknown values fall back to default. Values: default, secondary, outline, destructive. Default: default. |
size | Component scale; unknown values fall back to default. Values: sm, default, lg. Default: default. |
heading | Optional status heading. |
description | Escaped status text. |
urgent | Boolean. Use role=alert for urgent, dynamically inserted errors only. |
Use unquoted booleans, for example true and false, rather than strings.
Customize this instance
{{> "components/alert" heading="You are all set" description="Your theme is ready to customize." class="rounded-xl border-purple-500"}}Styling parameters
| Parameter | Target |
|---|---|
class | Component root — .ghcn-ui-alert |
titleClass | .ghcn-ui-alert__title |
descriptionClass | .ghcn-ui-alert__description |
Styling parameters affect only elements that render. See Style component instances for specificity, dark mode, and preserving customizations.
Installed files
partials/components/alert.hbsassets/css/components/alert.css
Was this helpful?