ValyroUI Русская версия

Alert

Inline alerts. Free, MIT · Overlays and notifications › Messages and status

Inline message. Warning and danger are announced immediately (role="alert"), others politely.

Installation

npx valyro-cli@latest add alert
npx shadcn@latest add https://valyro.xyz/r/alert.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Alert } from 'valyro-ui';

Props

PropTypeDefault
variant'info' | 'success' | 'warning' | 'danger' | 'neutral''info'Status color and default icon; warning and danger are announced immediately (role="alert").
titleReactNodeBold first line of the message.
descriptionReactNodeBody text under the title, or the whole message when there is no title.
iconReactNodeReplaces the variant's default icon; null hides it.
actionReactNodeButtons or links shown at the end of the alert.
onDismiss() => voidShows a close button that calls this.
dismissLabelstring'Dismiss'Accessible name of the close button.

Compound parts

Alert.Title (AlertTitle), Alert.Description (AlertDescription), Alert.Action (AlertAction)

Related components

Previous: Keyboard Map Overlay · Next: Toast · All Overlays and notifications