Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Toaster: support progress bars #6063

Closed
undefined-moe opened this issue Apr 9, 2023 · 4 comments
Closed

[Feat] Toaster: support progress bars #6063

undefined-moe opened this issue Apr 9, 2023 · 4 comments

Comments

@undefined-moe
Copy link

Environment

N/A

Feature request

Are there any future plans for creating a progress bar under the a toast?
There are two use cases:

  1. Loading items (showing a persistent toast, only changing the progress bar, instead of emitting lots of toasts)
  2. Indicating how long the toast are going to close (a decreasing progress)

Examples

const toaster = Toaster.create(...);
const id = toaster.show({ ..., progress: 0.1 });
toaster.get(id).setProgress(0.2); // In some callbacks
@rafaellichen
Copy link

rafaellichen commented Apr 13, 2023

It's possible to implement a toast with progress bar element inside yourself; reference the example here.
You can try it out here by clicking the "Upload file" button.

@adidahiya
Copy link
Contributor

@rafaellichen is right, it's even demonstrated in our own docs-app. Check out those links above.

@undefined-moe
Copy link
Author

Oh it might be mistaken.
I'd like to have a progress bar at the bottom of the toaster, instead of displaying a progress inside the body section, which makes it hard to display progress with some text.

and here's a demo: https://stackblitz.com/edit/angular-snack-bar-with-progress-bar-dmxhfy?file=app/snack-bar/snack-bar.component.ts

@adidahiya
Copy link
Contributor

"Snack bar" from your stackblitz:

2023-04-18 09 11 25

This is just a slight difference in styling. If you want to render a progress bar like this, you can do so with a few lines of custom CSS. The Blueprint design system doesn't really support visuals like that progress bar on the edge of a container out-of-the-box, so you'll have to write some CSS to get there, but there's nothing stopping you from doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants