--- url: /reference/items/Toaster/js-api.md --- # JS API ## Toaster ### Options #### `duration` * Type: `Number` * Default: `5` The default lifetime of a toast, in seconds (matching the [`Timer`](/reference/items/Timer/) convention), before it auto-dismisses. Set it with `data-option-duration` on the `Toaster` element, or override it per toast through the `duration` field of [`show()`](#show). It is written onto each toast as [`Toast`](#toast)'s `delay`; a value of `0` disables the toast's autostart, leaving it sticky until closed on demand. ```html {2}
...
``` ### Refs #### `polite` * Type: `HTMLElement` The `aria-live="polite"` region receiving every non-error toast. Announced once the screen reader is idle. Required. #### `assertive` * Type: `HTMLElement` The `aria-live="assertive"` region receiving `error` toasts, announced immediately. Optional — when absent, error toasts fall back to the `polite` region. #### `template` * Type: `HTMLTemplateElement` The `