Alert
A composed message with clear emphasis and announcement semantics you control.
Interactive preview
You can continue editing this workspace.
This static example uses a note. Reserve role="alert" for urgent updates.
Usage
import { Alert } from "@devvy-ui/react";
<Alert tone="brand">
<strong>Changes saved.</strong>
<p>Your workspace is up to date.</p>
</Alert>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | neutral | brand | danger | neutral | Border and decorative icon tone. Message text carries meaning. |
| variant | soft | outline | soft | Surface treatment. |
| role | native ARIA role | status | Polite updates by default; use alert for urgent changes or note for static guidance. |
| icon | ReactNode | information icon | Decorative only. Keep essential information in the message. |
Accessibility & behavior
Platform Behavior & Guidelines
Compose headings, descriptions and actions as children. Announcements are most reliable when an existing live region receives changed content; initial page content is not guaranteed to be announced. Avoid nested live regions and interactive icon content. Dismissal state belongs to the caller. In a Glass scope the surface can adopt the optional material. Native div props, styles and refs are forwarded.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add alertMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.