transition-behavior
Limited availability93% of users
Allows you to enable transitions for properties that normally switch instantly, like 'display'. By setting it to 'allow-discrete', you can create entry and exit animations for elements that are removed from the DOM or hidden.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in Firefox yet, so not every major browser supports it.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
normal- Inherited
- No
- Applies to
- all elements
- Animation type
- notAnimatable
Quick example
dialog {
transition: display 0.5s, overlay 0.5s, opacity 0.5s;
/* Enables smooth transitions for the 'display' property */
transition-behavior: allow-discrete;
}Related snippet
Animating display none without workaroundsAnimation →transition-behavior browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage93%of people can use this7% use a browser without it.
Browsers
117+
17.4+
117+Mobile
117+Android
17.4+iOS