Angular Material mdToast
service documentation shows the position can be any combination of 'bottom', 'left', 'top', 'right', 'fit'
.
How do I customize the toast to show at 'top center'
position?
what is this 'fit'
option for? changing the demo code to below did not help
$mdToast.simple()
.content('Simple Toast!')
.position('fit')
.hideDelay(3000)
if you want to center the toast just add
md-toast.md-top {
left: 50%;
margin-left: -150px;
}
to your CSS and you are all set. -150 is half the width of my toast
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With