Toast: Less Verbose syntax
Describe the feature you would like to see added
The Toast component requires us to write full definition of attributes each time we want to add one in the application.
toast.add({severity:'info', summary: 'Info Message', detail:'Message Content', life: 3000});
Allowing some configurable default values would be useful. As well, taking a page from many logging/notification libraries and allowing to code something like toast.error("Error Message Here") or toast.warn("Warn Message Here") could be nice and clean.
Having to specify life each time (unless I'm mistaken and there is an easy way to globally set it) seems counterintuitive as well since a toast life would probably be constant across an entire application.
Describe alternatives you have considered
Other libraries like https://github.com/Maronato/vue-toastification. But if already using PrimeVue would much rather not import another library for a better syntax.
I had this same issue when using the toaster, so I made a wrapper utility class that essentially allows using the toaster in the way that you're describing. It would be better if something like that was just built in to the design of the toaster, but this works for me for now:
https://gist.github.com/parkersprouse/5824b16cd25d8566a880e38a84b9be1d
Issue tracker is used for defects only as part of our commitment to quality and continuous improvement in all areas. Enhancements are collected as valuable community feedback and managed internally so moving this enhancement ticket to our internal project management backlog.