Ghostcn
Skip to Content
ComponentsPrimitives

Alert

An accessible status message with an optional urgent announcement.

Install

npx ghostcn@1.4.0 add alert --skip-existing

Usage

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

ParameterBehavior
variantVisual treatment; unknown values fall back to default. Values: default, secondary, outline, destructive. Default: default.
sizeComponent scale; unknown values fall back to default. Values: sm, default, lg. Default: default.
headingOptional status heading.
descriptionEscaped status text.
urgentBoolean. 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

ParameterTarget
classComponent 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.hbs
  • assets/css/components/alert.css

View the registry source

Edit this page on GitHub

Was this helpful?

On this page