question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programatically accessible slots for Toasts

See original GitHub issue

Is your feature request related to a problem? Please describe…

Most of the time when I create a toast I’m doing it programmatically (aka via this.$bvToast) rather than an inline <b-toast> component. However, I also need to be able to include buttons and links and other content in the body of the toast. I cannot see a way to do that right now.

Describe the solution you’d like

I’d like to be able to inject content into the slot programatically. One way would be to allow me to do an inline template. Another way would be to give me a reference to the component created by $bvToast so that I could manipulate the slot via:

component.$slots.default = put content here

Describe alternatives you’ve considered

I can’t think of any work arounds for this other than just not using toasts. If I had a work around I likely wouldn’t even have filed a feature request.

Additional context

Here’s a simple contrived example.

simple contrived example

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pitahbreadcommented, Oct 13, 2020

Is there a way to update the nodes once the toast has been created/shown?

1reaction
rizencommented, May 8, 2019

Yeah this is a game changer of a feature. I feel like there are light bulbs exploding above my head right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shadow DOM slots, composition
Slots allow to show elements from light DOM in specified places of shadow DOM. There are two kinds of slots: Named slots: <slot...
Read more >
Toast | Components - BootstrapVue
Push notifications to your visitors with a toast, a lightweight and easily customizable ... Slots are only available when using the <b-toast> component....
Read more >
Create your own accessibility service - Android Developers
An accessibility service is an application that provides user interface enhancements to assist users with disabilities, ...
Read more >
ion-toast Component: A Dismissible App Notification Alert
A Toast is a subtle notification commonly used in modern applications. It can be used to provide feedback about an operation or to...
Read more >
Vue Toast Component - PrimeFaces
There are four positions available for the toast container defined by the position property that defaults to "top-right". Other valid values are "top-left",...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found