import { Component } from '@angular/core' ; import { MatSnackBar , MatSnackBarHorizontalPosition , MatSnackBarVerticalPosition , } from '@angular/material' ; title @ Component ( { selector : 'snack-bar-position-example' , templateUrl : 'snack-bar-position-example.html' , } ) export class SnackBarPositionExample { horizontalPosition : MatSnackBarHorizontalPosition = 'start' ; verticalPosition : MatSnackBarVerticalPosition = 'bottom' ; constructor ( public snackBar ) { } openSnackBar ( ) { this . snackBar . open ( 'Canonball!!' , 'End now' , { duration : 500 , horizontalPosition : this . horizontalPosition , verticalPosition : this . verticalPosition , } ) ; } }