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 texticon— custom icon name (default: type-appropriate icon)closable— show dismiss buttonvariant—filled|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