Repository navigation
Change the default toast duration #28185
Description
Activity
Hi @vanillajonathan,
You can override that by passing options when you create your toasts for example:
$('#yourToast').toast({ delay: 2000 })
But you're right on one thing, we should be able to change the default options of our Toast plugin, to allow you to change that for all of your toasts 🤔
- changed the title
[-]Change the default toast duration[/-][+]Allow to change default config for Toasts[/+]on Feb 6, 2019 - addedjsJavaScript or TypeScript sources and pluginsJavaScript or TypeScript sources and pluginsv4v4, the frozen docs on gh-pagesv4, the frozen docs on gh-pages
on Feb 6, 2019 @vanillajonathan #28186 merged so in our next release you'll be able to do:
bootstrap.Toast.Default.delay = 2000
And it'll be the default delay for all of your toasts 😉
Yes, I am aware that the duration can be changed by passing in options. My point was that the default duration is too short.
Also my request is not for the introduction of a variable or property to define the default duration, but for the Bootstrap project to consider increasing the default duration.
Reacted by Jon Lawton, Deckluhm, melino and Rohit Sharma- changed the title
[-]Allow to change default config for Toasts[/-][+]Change the default toast duration[/+]on Feb 6, 2019 vanillajonathan commented
on Jul 14, 2020 ContributorAuthorMore actionsAndroid have constants for a long and a short duration, they are 4 seconds for the short toast and 7 seconds for the long toast.
These might be well thought out (or not?) durations backed by UX research.
static final long SHORT_DURATION_TIMEOUT = 4000; static final long LONG_DURATION_TIMEOUT = 7000;
The default toast duration is 500 milliseconds.
I would argue that this duration is too short which leads to the toast often disappearing before user can fully read the toast message.
I argue in favor of raising the default toast duration.
Android also have the concept of toasts and provides two constants.
SHORT_DELAYat 2000 ms andLONG_DELAYat 3500 ms.