TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jamiebuilds/tailwindcss-animate/llms.txt
Use this file to discover all available pages before exploring further.
direction-{keyword} utilities set the animation-direction property on an element, controlling whether an animation runs forward, backward, or alternates between the two on successive cycles. This lets you create ping-pong effects or reverse animations without writing extra keyframes.
Reference
| Class | Properties |
|---|---|
direction-normal | animation-direction: normal; |
direction-reverse | animation-direction: reverse; |
direction-alternate | animation-direction: alternate; |
direction-alternate-reverse | animation-direction: alternate-reverse; |
Direction values
normal— The animation plays forward each cycle. This is the default browser behavior.reverse— The animation plays backward each cycle, running keyframes from 100% to 0%.alternate— The animation plays forward on odd cycles and backward on even cycles, creating a back-and-forth effect.alternate-reverse— The animation plays backward on odd cycles and forward on even cycles, the inverse ofalternate.
Basic usage
Changing animation direction
Apply adirection-{keyword} class alongside any animation class to control the playback direction.
Applying conditionally
Hover, focus, and other states
Use variant modifiers to apply a direction only in a specific state. For example,hover:direction-normal resets the direction to forward on hover.
Breakpoints and media queries
Prefix any direction utility with a responsive breakpoint to apply it only at that screen size and above.Customization
Extending the theme
Add custom direction values by extendinganimationDirection in your tailwind.config.js file.