Solvedmaterialize different colors for different toasts

I would like to show the toast like "Saved Successfully", "Please check your entry" and so on. for each information i wanna popup toast with different colors. For successfull message, toast color wanna be green, for error it should be red and so on.

15 Answers

✔️Accepted Answer

In Updated Version, It's something like:

M.toast({
html: 'Data updated Successfully',
classes: 'green darken-1 rounded'
});

Other Answers:

Materialize.toast('I am a toast!', 3000, 'blue rounded') 

Like @Kail0 mentioned... It's in the documentation - dialogs

It's in the documentation - dialogs

Styling Toasts

Materialize.toast('I am a toast!', 3000, 'blue') 

'blue' is the class I'm applying to the toast for color


edit: few examples

HTML

  <a class="btn" onclick="Materialize.toast('I am a toast', 4000, 'blue')">Toast!</a>

jQuery

<a id="something" class="btn">Toast!</a>
$('#something').click(function(){
    Materialize.toast('I am a toast!', 3000, 'blue')
});

More Issues: