import { Alert } from "@pixxl-tools/components";
// In Server Components:
import { Alert } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | — | Title (any content). |
tone | Extract<Tone, "danger" | "info" | "success" | "warning"> | — | Colour role (neutral, primary, danger, success, warning, info). |
actions | ReactNode | — | Action slot (buttons or links). |
icon | FeedbackIcon | — | Leading icon. Default: the tone icon; false hides it. |
live | FeedbackLive | — | Announce the alert when it appears or changes. Default: static (no live role), which suits callouts rendered with the page. true uses role="alert" for danger and role="status" otherwise. |
titleReactNode
Title (any content).
toneExtract<Tone, "danger" | "info" | "success" | "warning">
Colour role (neutral, primary, danger, success, warning, info).
actionsReactNode
Action slot (buttons or links).
iconFeedbackIcon
Leading icon. Default: the tone icon; false hides it.
liveFeedbackLive
Announce the alert when it appears or changes. Default: static (no live role), which suits callouts rendered with the page. true uses role="alert" for danger and role="status" otherwise.
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
Status
Complex object props use fixed fixtures. Primitive props stay editable.
<Alert tone="info" title="Status">Saved.</Alert>Saved
<Alert tone="success">Saved</Alert>Status
<Alert tone="info" title="Status">Saved.</Alert>