Reference Source
import {Toast} from '@adobe/coral-spectrum'
public class | source

Toast

Expression Extends:

class Toast extends BaseOverlay(BaseComponent(HTMLElement))

Toasts display brief temporary notifications. They are noticeable but do not disrupt the user experience and do not require an action to be taken.

See:

Example:

Markup
<coral-toast></coral-toast>
JS constructor
new Coral.Toast();

Static Member Summary

Static Public Members
public static

Returns Toast placement options.

public static

Returns Toast variants.

Member Summary

Public Members
public

The actionable item marked with [coral-toast-action].

public

Whether the Toast will be dismissed automatically after a certain period.

public

The Toast content element.

public

open: *

Inherited from BaseOverlay#open.

public

The Toast placement.

public

The Toast variant.

Static Public Members

public static placement: ToastPlacementEnum: * source

Returns Toast placement options.

public static variant: ToastVariantEnum: * source

Returns Toast variants.

Public Members

public action: HTMLElement source

The actionable item marked with [coral-toast-action]. Restricted to Button or AnchorButton elements. Actionable toasts should not have a button with a redundant action. For example “dismiss” would be redundant as all toasts already have a close button.

  • read-only

public autoDismiss: Number source

Whether the Toast will be dismissed automatically after a certain period. The minimum and default value is 5 seconds. The dismissible behavior can be disabled by setting the value to 0. If an actionable toast is set to auto-dismiss, make sure that the action is still accessible elsewhere in the application.

  • 5000 by default.

public content: ToastContent source

The Toast content element.

  • content-zone

public open: * source

Inherited from BaseOverlay#open.

public placement: String source

The Toast placement. See ToastPlacementEnum.

  • ToastPlacementEnum.CENTER by default.

public variant: String source

The Toast variant. See ToastVariantEnum.

  • ToastVariantEnum.DEFAULT by default.
  • reflected