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.
fill-mode-{keyword} utilities set the animation-fill-mode property on an element, controlling which styles the element retains before the animation starts and after it ends. This is particularly useful when you need an element to stay in its final animated position or take on its initial keyframe styles during a delay period.
Reference
| Class | Properties |
|---|---|
fill-mode-none | animation-fill-mode: none; |
fill-mode-forwards | animation-fill-mode: forwards; |
fill-mode-backwards | animation-fill-mode: backwards; |
fill-mode-both | animation-fill-mode: both; |
Fill mode values
none— The element reverts to its original styles before and after the animation plays. This is the default browser behavior.forwards— After the animation ends, the element retains the styles defined in the last keyframe.backwards— During the delay period before the animation starts, the element takes on the styles of the first keyframe.both— Combines the behavior offorwardsandbackwards: the element applies the first keyframe during the delay and retains the last keyframe after the animation ends.
Basic usage
Changing animation fill mode
Apply afill-mode-{keyword} class alongside any animation class to control how styles are applied outside the active animation period.
Applying conditionally
Hover, focus, and other states
Use variant modifiers to apply a fill mode only in a specific state. For example,hover:fill-mode-forwards retains the final animated styles when the user hovers over the element.
Breakpoints and media queries
Prefix any fill mode utility with a responsive breakpoint to apply it only at that screen size and above.Customization
Extending the theme
Add custom fill mode values by extendinganimationFillMode in your tailwind.config.js file.