v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Alert

A composed message with clear emphasis and announcement semantics you control.

Interactive preview

Your changes are saved.

You can continue editing this workspace.

Review your connection.

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:

PropTypeDefaultDescription
toneneutral | brand | dangerneutralBorder and decorative icon tone. Message text carries meaning.
variantsoft | outlinesoftSurface treatment.
rolenative ARIA rolestatusPolite updates by default; use alert for urgent changes or note for static guidance.
iconReactNodeinformation iconDecorative 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 alert

Make 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.

Alert.tsxREACT / TSX

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.