Alert
A new version is available
A new version is available
An inline message that reports a status, with an optional action and close button.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For a message about the page or a task: saved, needs attention, failed. For the same message floated and temporary, call toast() from the code that did the work.
Something that needs a decision before going on? Dialog.
An urgent alert is announced at once (role="alert"); others politely. The tone is said in words, not just shown in color.
import { Alert } from '@idyeah/diya'Stable since 1.0.0
childrenRequiredReactNodeVisible message.
action{ label: string; onClick: () => void; }One visible button after the message; label is its text.
layout"card" | "banner"'card' is a contained box; 'banner' is a full-width strip with its content in one row. Defaults to 'card'.
Default 'card'
onDismiss() => voidWhen given, shows a close button that calls it.
titlestringVisible bold first line.
toneAlertTone'info' for information, 'success' done, 'warning' needs care, 'error' failed, 'brand' the provider's brand color; sets the icon and color and is announced before the message. Defaults to 'info'.
Default 'info'
urgentbooleanAnnounces immediately as role="alert", interrupting a screen reader; otherwise it is a polite status. Use for errors that need action.
Default false
Also takes every native <div> attribute, such as id, aria-* or data-*.