Toast
- Layer: Component
- Base:
@ark-ui/solid/toast+ portalled<Toaster />mount
Click to fire
Mounting
Section titled “Mounting”<Toaster /> is mounted once at the app root. After that, any module can call toast.create({ … }):
import { toast } from "@risingswamp/design-system";
toast.create({ title: "Finding archived to vault.", description: "0471b3 · just now",});toast.create({ title: "Mirror degraded — no action required.", description: "swamp-east-2 · catching up", type: "phenomenon",});| Visual element | Token / value |
|---|---|
| Container | --colors-bg-emphasized fill, 1px --colors-border, 3px left strip in accent colour. |
| Title | Sans · --colors-fg-default · medium. |
| Description | Mono · 10px · --colors-text-muted. |
| Default strip | --colors-accent-default. |
| Phenomenon strip | --colors-glory (Plane-2 accent). Falls back to --colors-accent-default. |
| Function | Signature | Notes |
|---|---|---|
toast.create | (opts: { title, description?, type?, duration? }) | Pushes a toast onto the queue. |
toast.dismiss | (id?: string) | Dismiss one or all. |
<Toaster /> | Component | Mount once at the app root. |
Plane 1 Constraints
Section titled “Plane 1 Constraints”The accent strip and left-border treatment are the only emphasis. No drop shadow on the toast container — the 3px coloured strip + 1px border + --colors-bg-emphasized fill are sufficient to separate it from any surface. Phenomenon variant uses --colors-glory (Plane-2 accent) specifically for Plane-2 phenomenon signalling — it does not elevate the toast; it marks its source.
Accessibility
Section titled “Accessibility”Wraps @ark-ui/solid/toast, which manages role="status" for default toasts and role="alert" for type: "error". The close button carries aria-label="Dismiss". Toast timing respects prefers-reduced-motion via Ark’s default behaviour; announcements are batched so rapid toast.create() calls don’t flood the screen-reader queue.
Props (toast.create)
Section titled “Props (toast.create)”| Option | Type | Default | Description |
|---|---|---|---|
title | string | required | Primary message (sans, medium, --colors-fg-default). |
description | string | — | Secondary line (mono, 10px, --colors-text-muted). |
type | "info" | "error" | "phenomenon" | "info" | Controls the accent strip colour. phenomenon uses --colors-glory. |
duration | number (ms) | 5000 | How long the toast stays mounted. Pass Infinity for persistent toasts. |