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

[Feature] Add auto close to Toast component #177

Closed
kuchaguangjie opened this issue Jul 22, 2022 · 6 comments
Closed

[Feature] Add auto close to Toast component #177

kuchaguangjie opened this issue Jul 22, 2022 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kuchaguangjie
Copy link

Summary

It can be closed by click close icon now.
Wondering is it possible to provide an optional timeout (e.g 5 seconds) after which the <Toast> will auto close.

Basic example

Like this one: https://sveltematerialui.com/demo/snackbar/
It can pop-out for default 5 seconds, or close by click the close icon.

@kuchaguangjie kuchaguangjie added the enhancement New feature or request label Jul 22, 2022
@kuchaguangjie
Copy link
Author

Or, is there an existing component for this?
I've checked <alert>, <toast>, <modal>, <tooltip>, seems <toast> is the closest one.

@kuchaguangjie
Copy link
Author

Or, at least export the visible property, or a close() method, to let user close in other ways.

@shinokada shinokada changed the title Pop-out <Toast> for a while, then auto close. [Feature] Add auto close to Toast component Jul 22, 2022
@shinokada shinokada added the help wanted Extra attention is needed label Jul 22, 2022
@shinokada shinokada added this to To do in Flowbite-Svelte via automation Jul 22, 2022
@jjagielka
Copy link
Contributor

I was thinking of adding setTimeout default implementation, but decided not to as it would be too specific and it's easy to do by user.

Exporting visible should do the trick though.

@shinokada
Copy link
Collaborator

Can we add an example for users?

@jjagielka
Copy link
Contributor

Sure. Will do.

Flowbite-Svelte automation moved this from To do to Done Jul 22, 2022
@shinokada
Copy link
Collaborator

Thanks to @jjagielka .
#178
Added the feature to commit #2127151550a778d35bee5eb3b2b77f38423f50e4
I will update the version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Development

No branches or pull requests

3 participants