Skip to content

Toast

  • Layer: Component
  • Base: @ark-ui/solid/toast + portalled <Toaster /> mount

Click to fire

<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 elementToken / value
Container--colors-bg-emphasized fill, 1px --colors-border, 3px left strip in accent colour.
TitleSans · --colors-fg-default · medium.
DescriptionMono · 10px · --colors-text-muted.
Default strip--colors-accent-default.
Phenomenon strip--colors-glory (Plane-2 accent). Falls back to --colors-accent-default.
FunctionSignatureNotes
toast.create(opts: { title, description?, type?, duration? })Pushes a toast onto the queue.
toast.dismiss(id?: string)Dismiss one or all.
<Toaster />ComponentMount once at the app root.

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.

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.

OptionTypeDefaultDescription
titlestringrequiredPrimary message (sans, medium, --colors-fg-default).
descriptionstringSecondary line (mono, 10px, --colors-text-muted).
type"info" | "error" | "phenomenon""info"Controls the accent strip colour. phenomenon uses --colors-glory.
durationnumber (ms)5000How long the toast stays mounted. Pass Infinity for persistent toasts.