Alert
Inline message with semantic colors, title, description, and dismiss action.
Preview
Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.
Playground
Flip props to see how the component responds. The snippet below updates as you change options.
Installation
Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.
$ pnpm add @sisyphos-ui/reactThen import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";
Usage
import { Alert } from "@sisyphos-ui/react";
export const Saved = () => (
<Alert color="success" title="All set" description="Your settings have been saved." />
);Variants
Real world — deployment banner
Alert inside a Card header, used to surface status over content.
Next build will inherit this configuration. Review the diff to confirm the rollout window.
API
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "contained" | "outlined" | "soft" | "soft" | Visual treatment. |
| color | "primary" | "success" | "error" | "warning" | "info" | "info" | Semantic color; also selects the default icon and the inferred ARIA role. |
| title | ReactNode | — | Alert heading. |
| description | ReactNode | — | Supporting copy rendered below the title. |
| icon | ReactNode | null | — | Override the default semantic icon; pass `null` to hide it. |
| actions | ReactNode | — | Action slot (typically a `Button`). |
| onClose | (event?: MouseEvent) => void | — | When provided, renders the close button; also fires when `autoCloseDuration` elapses. |
| closeAriaLabel | string | "Close" | Accessible label for the close button. |
| autoCloseDuration | number | — | Auto-dismiss after this many ms; requires `onClose` to actually unmount the alert. |
| role | string | — | Override the inferred live-region role. |
The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.
Accessibility
Adheres to the Alert WAI-ARIA design pattern.
- The live-region role is inferred from
color:role="alert"(assertive) whencolor="error",role="status"(polite) otherwise — overridable via theroleprop. - The close button is a native
<button>labeled throughcloseAriaLabel(defaults to"Close"). - Default semantic icons are decorative SVGs marked
aria-hidden="true"— the message text carries the meaning.