Skip to content

Built-in Alert Banner component (<StxAlert>) #1683

@glennmichael123

Description

@glennmichael123

Summary

Static page-level alert banners for informational messages, warnings, and errors. Different from stxAlert() (which is an imperative dialog) — this is a declarative inline banner.

Usage

<StxAlert type="info" title="Note">
  This feature is in beta. <a href="/docs/beta">Learn more</a>
</StxAlert>

<StxAlert type="warning" closable>
  Your trial expires in 3 days.
</StxAlert>

<StxAlert type="error" icon="alert-circle">
  Failed to connect to the database.
</StxAlert>

<StxAlert type="success" title="Deployed!" closable>
  Your changes are now live.
</StxAlert>

Props

  • type: info | warning | error | success (default: info)
  • title — bold heading text
  • icon — custom icon name (default: type-appropriate icon)
  • closable — show dismiss button
  • variantfilled | outline | subtle (default: subtle)

Features

  • Slot content supports HTML (links, bold, etc.)
  • Type-specific left border + icon color
  • Dismiss with fade-out animation
  • Dark mode support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions