Page:
Toaster
Pages
Accordion
AccordionItem
Alert
Avatar
Badge
BarChart
Button
ButtonGroup
Card
Changelog
ChartLegend
Checkbox
CodeEditor
Collapsible
Combobox
CommandPalette
ContextMenu
CopyButton
DatePicker
Dialog
DonutChart
Drawer
Field
FileInput
FileList
Forms
Gauge
Getting started
Heatmap
Home
Image
InlineEdit
Input
Kbd
Label
LineChart
Menu
MultiSelect
NumberInput
Overlays
Pagination
Popover
Progress
RadioGroup
Scroller
Select
Separator
ShareBar
Sheet
Skeleton
Slider
Sparkline
Spinner
StatCard
Switch
Table
Tabs
TagsInput
Textarea
Theming
Toaster
Toggle
Tooltip
Tree
No results
2
Toaster
L4stIdi0t edited this page 2026-09-21 11:20:10 +02:00
Toaster
Melt/sonner-style toaster: toasts collapse into a peeking stack at the bottom-right and fan out on hover/focus.
Countdowns pause while hovered. aria-live=polite region; error toasts use role="alert". Portalled to the body and flagged data-driftwood-live, so a Dialog's inert background leaves it alone — a toast raised over a modal stays announced and dismissable.
Feedback · portalled to <body> · keyboard contract
<script lang="ts">
import { Toaster } from '@l4st/driftwood';
</script>
| Light | Dark |
|---|---|
![]() |
![]() |
Props
No props.
Keyboard
| Key | Does |
|---|---|
| Escape | dismiss the focused toast |
Example
The markup behind the screenshot above, lifted from src/routes/shots/ — so it
compiles, and it is exactly what produced the image.
<script lang="ts">
import { Toaster, toast } from '$lib/index.js';
import { onMount } from 'svelte';
onMount(() => {
toast.success({ title: 'Scan complete', description: '2.56M files indexed.', duration: 0 });
toast.error({ title: 'Scan failed', description: 'Permission denied on /mnt/cold.', duration: 0 });
toast({ title: 'Settings saved', duration: 0 });
});
</script>
<Toaster />
Feedback · Badge · Alert · Progress · Spinner · Skeleton · Avatar · Image
driftwood
Layout
Actions
Forms
- Field
- Input
- FileInput
- FileList
- Textarea
- CodeEditor
- Combobox
- RadioGroup
- NumberInput
- InlineEdit
- Label
- Select
- MultiSelect
- DatePicker
- TagsInput
- Checkbox
- Switch
- Slider
Feedback
Charts
Overlays
Navigation
Generated from the source by pnpm wiki · repository · v0.24.0

