Languages
[Edit]
EN

React - animation example with CSS transition property

3 points
Created by:
Lani-Skinner
748

In this article, we would like to show you how to use transition style property in React.

Below example presents two style objects: myComponentNormnal and myComponentBig with transition value set to '0.5s'. It means our component will change it's property values smoothly, over a given duration (0.5s).

Runnable solution:

Note:
If the duration is not specified, the transition will have no effect, because the default value is 0.

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

ReactJS

React - animation with transition property
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join