Toast
Global notification island for redirect-flash feedback.
All components · Theme builder · Implementation source
Live preview
Install
netscript ui:add toastUsage and examples
The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.
import { useState } from 'preact/hooks';
import { Button } from '@app/components/ui/button.tsx';
import Toast from '@app/islands/ui/Toast.tsx';
export function Example() {
const [value, setValue] = useState('standard');
const [open, setOpen] = useState(false);
const [notice, report] = useState('');
return (<><div><div><Button onClick={()=>report("Order saved")}>Show toast</Button><Toast message={notice} type="success" duration={60000} /></div></div><p role="status">{notice}</p></>);
}Props
Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.
| Owner | Prop | Type | Optional | Description |
|---|---|---|---|---|
ToastIslandProps | cleanUrl | string | Yes | |
ToastIslandProps | duration | number | Yes |
ToastIslandProps extends Partial<RegistryToast>Keyboard
Presentation component; no component-specific keyboard interactions.
Tokens
Semantic contract roles: material/track, space/stack/gap, surface/muted, text/fg, text/muted.
CSS custom properties referenced directly: --ns-border, --ns-border-hover, --ns-border-strong, --ns-border-width, --ns-card, --ns-card-fg, --ns-card-padding, --ns-control-gap, --ns-destructive, --ns-destructive-border, --ns-destructive-subtle, --ns-destructive-text, --ns-ease-fast, --ns-fg, --ns-focus-ring-offset, --ns-focus-ring-width, --ns-font-mono, --ns-font-sans, --ns-info-border, --ns-info-subtle, --ns-info-text, --ns-leading-body, --ns-leading-strong, --ns-muted-fg, --ns-radius-card, --ns-radius-lg, --ns-radius-sm, --ns-ring, --ns-secondary, --ns-shadow-lg, --ns-size-icon-md, --ns-space-0-5, --ns-space-3, --ns-space-4, --ns-success, --ns-success-border, --ns-success-subtle, --ns-success-text, --ns-surface-raised, --ns-text-body, --ns-text-sm, --ns-text-strong, --ns-tracking-body, --ns-tracking-strong, --ns-warning, --ns-warning-border, --ns-warning-subtle, --ns-warning-text, --ns-weight-body, --ns-weight-strong, --ns-z-toast.
Contract and compatibility
Accessibility pattern: WAI-ARIA guidance
- Native DOM attributes pass through where the implementation accepts them.
- type=error is retained to match the settled Figma set; it uses destructive token roles.
- Utility compatibility anatomy is included for existing shipped helpers; it does not implement a design gap.
Design contract values marked planned are not implementation props. The props above describe what ships today.