Alert
Inline status banner that stays on the page.
A short note that floats in after an action, like Saved successfully, and goes away on its own after a few seconds, with an optional Undo.
A short note that floats in after an action, like Saved successfully, and goes away on its own after a few seconds, with an optional Undo.
Info, success and warning count down 5 seconds. Danger stays until closed. Point at the toast to pause. The stack shows at most three.
Use Toast to confirm an action people just took, or to offer a quick Undo. Render it with open and onClose, and set open when the action happens. It floats at the bottom right; several stack. Status colors the icon and the bar. For messages that must stay on the page, use Alert.
import { Toast } from "agentic-ds-kit";From contracts/toast.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| open | boolean | Yes | — | Shows the toast. Set it when the action happens. |
| onClose | function | Yes | — | () => void. Time up, Dismiss, or after the action. |
| title | string | Yes | — | The bold line, like Saved successfully. |
| description | string | No | — | One line under the title. |
| status | info | success | warning | danger | No | info | Colors the icon and the countdown bar. Card stays surface-card. info an i, success a check, warning a triangle, danger an alert mark. icon swaps the mark, avatar replaces it. |
| actionLabel | string | No | — | The first action under the text, like Undo. |
| onAction | function | No | — | () => void. Runs when the action is picked; the toast then closes. Required in practice when actionLabel is set. |
| secondaryAction | object | No | — | A second kit Button after the action, ghost neutral sm like the first, such as View or View trash. Renders only with actionLabel; two actions at most. Runs onClick, then the toast closes. Tab order: action, secondaryAction, then Dismiss. |
| avatar | object | No | — | The person (or organisation) the toast is about, as a kit Avatar in place of the status icon: md (32) at sm and md, lg (40) at lg. For info and success only. It is aria-hidden, so the title must name the person, like Maya Chen mentioned you. Wins over icon. |
| icon | KitIcon | No | — | Replaces the status icon and keeps the status color, like Upload on a file uploaded toast. Decorative (aria-hidden). Ignored when avatar is set. A curated Lucide name (PascalCase or kebab-case) renders instantly; any other Lucide name needs import "agentic-ds-kit/icons-on-demand" once. Or pass the Lucide component or an element. |
| duration | number|null | No | 5000 | How long it stays, in ms, while the bar counts down. Default 5000 for info, success and warning. danger defaults to null: it stays until closed, with no bar. null keeps any status open. |
| size | sm | md | lg | No | md | Padding and title size. sm for a short confirmation, lg for a toast with a description and an action. |
| progress | number | No | — | 0 to 100. Shows a progress bar instead of the countdown and keeps the toast open. When the work ends, clear progress and set status=success. |
| timestamp | string | No | — | Preformatted time on the right of the header, like Now or 09:41. |