Toast on demand without title/templating?
See original GitHub issueOk, the following is “opinionated” so I’m rising this… accordingly… more to get an official stance that to rant… 😉
I’ve dropped the previous toast library I was using when toasts got into bootstrap-vue and I know that the styles are inherited by bootstrap. But I’m now leaning to rethink this.
When you use <b-toast>
, you control it all, but focus here is when using toast on demand.
I issue attention catching quick messages to my users and, as such, they do not really need a title but they need to be “catchy”.
When I issue a toast on demand without title, the heading is actually included, empty, and actually with more color relevance than the actual content.
Now question is: should toast on demand skip the header when there’s no title? And backup question is: should toast on demand render the toast content as header in order to get more impact (based on the fact that there’s no header)?
Is there a way to control this kind of stuff with bootstrap-vue (aka: controlling the template of a toast on demand)?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@EPinci The header is retained for the close button. But if you don’t specify a title, and set
noCloseButton: true
, then the title/header bar will not be rendered, just the body… and adding the optionsolid: true
will turn off transparency (actually it switches to a non-transparent color) to make them stand out a bit more.You can also pass a class (or classes) to be added to the toast, which can be used to override the coloring.
If you need HTML content in the toast body when using
this.$bvToast.toast()
, you can pass VNodes as the message (instead of a string).use
this.$createElement(...)
to return Vue vNodes.An example can be found here https://jsfiddle.net/rd8pqb74/ and https://jsfiddle.net/e9txmdv8/