Bootstrap: Change the default toast duration

Created on 6 Feb 2019  路  4Comments  路  Source: twbs/bootstrap

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_DELAY at 2000 ms and LONG_DELAY at 3500 ms.

js v4

Most helpful comment

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.

All 4 comments

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 馃

@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.

Android 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.

https://github.com/aosp-mirror/platform_frameworks_base/blob/android10-release/core/java/android/widget/Toast.java#L384

static final long SHORT_DURATION_TIMEOUT = 4000;
static final long LONG_DURATION_TIMEOUT = 7000;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellwood picture bellwood  路  3Comments

kamov picture kamov  路  3Comments

leomao10 picture leomao10  路  3Comments

MrCsabaToth picture MrCsabaToth  路  3Comments

iklementiev picture iklementiev  路  3Comments