Skip to components
DEVELOPER REFERENCE

Toaster API

Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.

Toaster6 props0 callbacks0 methods

Preset and CSS

Set preset.className to attach your CSS class to the component's rendered surface. Explicit component props take precedence over preset options.

CSS parts in the example [data-part="action"] [data-part="description"] [data-part="dismiss"] [data-part="icon"] [data-part="list"] [data-part="root"] [data-part="title"] [data-part="toast"]

State attributes in the example data-position data-tone

Use styles.root and styles.parts in a theme and generate a CSS file with themeToCss. For other JSON-friendly component props, spread presetProps(preset) before explicit props. Parts and states depend on configuration; the gallery shows those visible in the current preview.

Props6

Toaster props
NameTypeDescription
toasterRequired
ToastControllerInspect type
Notification controller created with createToaster. Mount one viewport per controller.
positionOptional
"inline" | ToastPosition | undefinedInspect type
Logical viewport corner or edge. Use inline to render within a layout.
visibleCountOptionalnumber | undefinedMaximum visible notifications. Older entries wait in the queue.
textOptional
{ notifications?: string; dismiss?: string; } | undefinedInspect type
Accessible names supplied by the host's localization system.
presetOptional
ClassPreset | undefinedInspect type
Reusable component appearance and option defaults. Explicit component props take precedence.
classNameOptionalstring | undefinedAdditional CSS classes applied to the component root.

Events and callbacks0

No component-specific events or callbacks.

Methods0

No component-specific imperative methods. Use props and callbacks to control this component.