Skip to main content

ToastComponent

from v9.4

ToastComponent renders the compact toast stack managed by toastManager.

Usage

import {PanelManager, ToastComponent, toastManager} from '@deck.gl-community/panels';

const manager = new PanelManager({
parentElement: document.getElementById('app') as HTMLElement
});

manager.setProps({components: [new ToastComponent()]});

toastManager.toast({
type: 'warning',
title: 'Build delayed',
message: 'Dependency graph refresh is still running',
key: 'build-status'
});

Props

type ToastComponentProps = PanelComponentProps & {
placement?: PanelPlacement;
showBorder?: boolean;
};

Remarks

  • ToastComponent extends PanelComponent, not PanelContainer.
  • Use ToastWidget from @deck.gl-community/widgets when the toast stack should be mounted through deck.gl.
  • See Toast Manager for toast lifecycle APIs.