Create dynamic and interactive UI elements with Tailwind's powerful transform and transition utilities
Tailwind CSS provides a set of utilities for applying CSS transforms and transitions, allowing you to easily animate and manipulate elements. Below are the key properties and examples for each, with brief explanations.
Control which properties transition when they change. Different transition properties apply to different CSS properties.
transition-colors
transition-opacity
transition-shadow
transition-transform
transition-all
transition-none
Control the speed curve of the transition with different timing functions. Each creates a different feel of movement.
transition-transform ease-linear
transition-transform ease-in
transition-transform ease-out
transition-transform ease-in-out
Combine timing functions with different properties for more nuanced animations:
Add a delay before the transition starts. This is useful for creating staggered animations or waiting for other actions to complete.
Set how long the transition takes. Shorter durations are good for subtle effects, while longer durations work well for more dramatic transformations.
Use scale utilities to resize elements. Scale values range from 0 (completely collapsed) to 150 (50% larger).
Use rotate utilities to rotate elements by specific degree increments.
Use translate utilities to move elements along X and Y axes. Values can be pixels, rems, or percentages.
Use skew utilities to distort elements along X and Y axes by specific degree increments.
Use origin utilities to change the position that transforms are applied from. This dramatically changes how rotations, scales, and skews behave.
scale-[1] rotate-[0deg] translate-x-[0px] translate-y-[0px] skew-x-[0deg] skew-y-[0deg] duration-[300] ease-linear
Combine multiple transform utilities for complex effects. The order doesn't matter as Tailwind combines them into a single transform.
Combine transition properties with hover effects for interactive elements.
Hover over this card to see the effect
Hover over this card to see the effect
Hover over this card to see the effect
These examples use CSS animations in combination with Tailwind's transform utilities.