Class IgcSnackbarComponent

A snackbar component is used to provide feedback about an operation by showing a brief message at the bottom of the screen.

Element

igc-snackbar

Slot

  • Default slot to render the snackbar content.

Slot

action - Renders the action part of the snackbar. Usually an interactive element (button)

Fires

igcAction - Emitted when the snackbar action button is clicked.

Csspart

base - The base wrapper of the snackbar component.

Csspart

message - The snackbar message.

Csspart

action - The default snackbar action button.

Csspart

action-container - The area holding the actions.

Hierarchy

Hierarchy

  • EventEmitterInterface<IgcSnackbarEventMap, this> & IgcBaseAlertLikeComponent<this>
    • IgcSnackbarComponent

Constructors

Properties

actionText: string

The snackbar action button.

Attr

action-text

displayTime: number = 4000

Determines the duration in ms in which the component will be visible.

Attr

display-time

keepOpen: boolean = false

Determines whether the component should close after the displayTime is over.

Attr

keep-open

open: boolean = false

Whether the component is in shown state.

Attr

position: "top" | "bottom" | "middle" = 'bottom'

Sets the position of the component in the viewport.

Attr

styles: CSSResult[] = ...
tagName: "igc-snackbar" = 'igc-snackbar'

Methods

  • Type parameters

    Type Parameters

    • K extends "igcAction"
    • D extends void

    Parameters

    • type: K
    • Optional eventInitDict: CustomEventInit<D>

    Returns boolean

  • Closes the component.

    Returns Promise<void>

  • Opens the component.

    Returns Promise<void>

  • Toggles the open state of the component.

    Returns void