Alert
An inline message box colored by severity, with an optional close button.
<arc-alert>Overview
Alert shows a message inline in the page. The variant sets the color and icon: info, tip, success, warning or error.
Unlike a toast, an alert stays on the page until the user dismisses it or leaves, so use it for messages the user has to acknowledge or keep seeing: a state change, a finished action, a problem. The body slot takes any inline or block content, including links, lists and buttons.
Alert absorbed arc-callout in v4. Callout was an emphasized aside that differed from an info alert only in styling. It brought three things with it: the tip variant for advice that is neither a status nor a problem, an icon slot that replaces the built-in status glyph, and the live prop below. Callout's derived uppercase label has no equivalent, so pass heading if you want one. See the tombstone for the full translation.
The role and announcement follow variant by default. error and warning are role="alert" and assertive, success is role="status" and polite, and info and tip are role="note" and aren't announced. That last one changed from v3, where info was a polite live region. info is the variant most likely to be static content, and announcing every informational box on load is noise.
Severity and urgency don't always agree, and live sets the announcement on its own. An info alert inserted after a background save wants live="polite", and a warning in the initial HTML probably wants live="off".
Guidelines
Do
- Keep the text short: lead with the outcome, then explain
- Add a heading when the body runs longer than one sentence
- Make an alert dismissible when the message is temporary
- Put an alert next to the content it's about, or at the top of the page for page-wide messages
- Use `tip` for advice that is neither a status report nor a problem
- Set `live` on an alert you insert after page load. The default goes by severity and can't know the alert just appeared
- Use the `icon` slot when the glyph should say something the variant doesn't, such as a product icon or a specific action
Don't
- Don't use `info` to get a live region. It is `role="note"` and isn't announced, so set `live="polite"`
- Don't stack more than two or three alerts. Combine them, or use toasts
- Don't use `error` for warnings. Keep it for failures
- Don't rely on color alone. The heading and text should make sense without it
- Don't make every alert dismissible. Leave critical errors on screen
Features
- `dismissible` adds a close button. Clicking it fires a cancelable `arc-close` event, then hides the alert
- `density="compact"` reduces padding and type size for forms and dense panels
Preview
Deployment complete
Faster builds
node_modules between CI runs to skip the install step.icon slot.
Usage
Its events and state need JavaScript, so use the Web Component or a framework wrapper for those.
<arc-alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</arc-alert>
<!-- tip: advice, not a status. Absorbed from arc-callout. -->
<arc-alert variant="tip" heading="Faster builds">
Add a <code>.arcignore</code> to skip files the bundler never reads.
</arc-alert>
<!-- info is role="note" and is not announced. Say so when it should be. -->
<arc-alert variant="info" live="polite" density="compact">
<arc-icon slot="icon" name="sparkle"></arc-icon>
Draft saved.
</arc-alert>import { Alert } from '@arclux/arc-ui-react';
export default function Example() {
return (
<Alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</Alert>
);
}<script setup>
import { Alert } from '@arclux/arc-ui-vue';
</script>
<template>
<Alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</Alert>
</template><script>
import { Alert } from '@arclux/arc-ui-svelte';
</script>
<Alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</Alert>import { Component } from '@angular/core';
import { Alert } from '@arclux/arc-ui-angular';
@Component({
imports: [Alert],
template: `
<arc-alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</arc-alert>
`,
})
export class MyComponent {}import { Alert } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<Alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</Alert>
);
}import { Alert } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<Alert variant="success" heading="Deployment complete" dismissible>
Your changes are now live on production.
</Alert>
);
}<!-- arc-alert is interactive — requires JS -->
<arc-alert></arc-alert><!-- arc-alert is interactive — requires JS -->
<arc-alert></arc-alert>API
ROLESobject{ error: 'alert', warning: 'alert', success: 'status', info: 'note', tip: 'note', }- Severity → ARIA role. V4-SCOPE §3.2, ratified 2026-08-13.
arc-alertalready implemented role-follows-severity, so most of this is a ratification of what the component did. The exception isinfo, and it is the reason the row needed a decision at all:infoused to map torole="status", which *is* a polite live region.arc-callout's default variant isinfoand it was a staticrole="note"box, so a naive merge would have upgraded every informational callout on every page into an announcement, landing the regression on the single most common variant. **Soinfoisnotenow, and that is a behaviour change for existingarc-alertusers too**, not only for callout's. The reasoning:infois the variant most likely to be static page furniture, and an alert that genuinely needs announcing has two ways to say so: pick a severity that carries one, or setlive. headingstring''- Optional bold heading rendered above the body slot. Use it for a scannable one-line summary so users can quickly gauge the alert's importance before reading the full message.
variant'info' | 'tip' | 'success' | 'warning' | 'error''info'- Controls the semantic color palette, the icon, and, through the
ROLEStable, the ARIA role and whether the alert is announced. Use "info" for neutral guidance, "tip" for advice, "success" for confirmations, "warning" for caution states, and "error" for failures or blocking issues. live'auto' | 'off' | 'polite' | 'assertive''auto'- Announcement behaviour.
auto(the default) derives it fromvariant: error and warning are assertive, success is polite, info and tip are not announced at all. Set it explicitly when severity and urgency disagree: aninfoalert injected after a background save wantspolite, and awarningrendered in the initial page probably wantsoff. dismissiblebooleanfalse- When true, renders a close button in the top-right corner. Clicking it removes the alert from the DOM and fires an "arc-close" event that parent components can listen to.
density'default' | 'compact''default'- Visual density. 'compact' reduces padding and font sizes for inline or space-constrained usage.
Events
arc-close- Fired when a dismissible alert is closed