CSS animation-play-state Property
Description
The animation-play-state property in CSS is used to control whether a CSS animation is running or paused at any given moment. Unlike defining the animation itself with properties such as animation-name or animation-duration, animation-play-state does not alter the way an animation behaves over time - it simply toggles its execution. This can be particularly useful for user interactions, such as pausing an animation when a user hovers over an element or when a page loses focus, without needing to remove or redefine the animation entirely.
One common use of animation-play-state is in conjunction with pseudo-classes like :hover or :focus, allowing developers to create interactive experiences. For example, a spinning loader or a bouncing icon can pause when a user hovers over it, giving them more control and improving usability. It also works seamlessly with animation-iteration-count, so animations that repeat a specific number of times can be paused mid-cycle and resumed exactly where they left off. This makes animation-play-state a valuable tool for fine-tuning animations without impacting other animation properties.
Additionally, animation-play-state can be leveraged in more complex scenarios involving multiple animations or dynamically triggered sequences. When paired with animation-delay, you can create staggered or conditional effects, pausing and resuming animations based on events or conditions in your JavaScript or CSS. Its simplicity in toggling between 'running' and 'paused' makes it an efficient way to manage animation flow without needing to manipulate keyframes or other core animation definitions, providing both control and flexibility in crafting sophisticated, responsive designs.
Definition
- Initial value
- running
- Applies to
- All elements, :before and :after pseudo elements
- Inherited
- No
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.animationPlayState
Interactive Demo
Syntax
animation-play-state: <single-animation-play-state> [ ',' <single-animation-play-state> ]*
Values
- runningThe animation is currently playing.
- pausedThe animation is currently paused.
Example
Browser Support
The following information will show you the current browser support for the CSS animation-play-state property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
