Tones
Icon and colour together carry the outcome.
import { Stack } from '@/components/Stack';
<Stack direction="column" gap="sm">
<Toast
title="Success!"
description="Your changes have been saved."Briefly reports what just happened, without blocking the page.
import { Toast } from "@/fragments/ui";Source<Toast
title="Draft saved"
description="We will keep it until you publish."
/>npx @usefragments/cli add toastWrites src/fragments/ui/components/Toast plus what it imports, the globals stylesheet, and .fragments/registry-lock.json, then prints the packages to add. No account, no key.
Your own registry: publish from Fragments Cloud and add --registry org/name. Connect a workspace.
Toast is a compound: import the root and reach its parts through dot notation.
Toast.ProviderIcon and colour together carry the outcome.
import { Stack } from '@/components/Stack';
<Stack direction="column" gap="sm">
<Toast
title="Success!"
description="Your changes have been saved."One-tap way back from something destructive.
<Toast
title="File deleted"
description="The file has been moved to trash."
action={{
label: 'Undo',
onClick: () => {},onDismiss adds a close button for longer messages.
<Toast
title="Export running"
description="We will email you when the file is ready."
tone="info"
onDismiss={() => {}}
/>Prop | Type | Default | Description |
|---|---|---|---|
onDismiss | function | Not set | Callback when toast should be dismissed |
title | string | Not set | Toast title |
description | string | Not set | Additional message content |
tone | enumneutralsuccessdangerwarninginfo | neutral | Colour on the shared status ramp; neutral is the plain notification. The useToast().error helper sets tone="danger". |
duration | number | 8000 | Auto-dismiss duration in ms (0 = no auto-dismiss) |
action | object | Not set | Optional action button { label, onClick } |
id | string | Not set | — |
onPause | function | Not set | Callback when auto-dismiss timer should pause |
onResume | function | Not set | Callback when auto-dismiss timer should resume |