> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# animation-play-state

APISummary
## Introduction

`animation-play-state` property specifies whether an animation is running or paused. When resuming a paused animation, it will continue from where it was paused rather than starting from the beginning of the animation sequence.

## Examples

**This is an example below: css-api**

**Entry:** `src/animation-play-state`
**Bundle:** `dist/animation-play-state.lynx.bundle`

```tsx
import { root, useState } from "@lynx-js/react";
import "./index.scss";

const AnimationPlayState = () => {
  const [playState, setPlayState] = useState(true);

  const degProperties = ["90deg", "180deg", "270deg"];
  const radProperties = ["1rad", "2rad", "3rad"];
  const turnProperties = ["0.25turn", "0.5turn", "0.75turn"];

  const containerStyle = {
    height: "150rpx",
  };

  const columnStyle = {
    width: "250rpx",
  };

  const getAnimationStyle = (index: number, playState: boolean) => ({
    animation: `deg-${index} 2s ease 0s infinite alternate both ${playState ? "running" : "paused"}` as const,
  });

  return (
    <view>
      <scroll-view scroll-orientation="vertical" className="fd-col container">
        <text className="h1" bindtap={() => setPlayState(!playState)}>Click to start animation</text>
        <text className="h1">Animation Play State Demo: Deg, Rad, Turn</text>
        <view className="sep"></view>

        <view className="fd-col group pd5">
          <text className="button h2">deg</text>
          <view className="fd-row" style={containerStyle}>
            {degProperties.map((item, index) => (
              <view style={columnStyle} className="fd-col mg5" key={item}>
                <text className="h4 mgl15">{item}</text>
                <view flatten={false} style={getAnimationStyle(index, playState)} className="ani-size mg5" />
              </view>
            ))}
          </view>
        </view>
        <view className="sep"></view>

        <view className="fd-col group pd5">
          <text className="button h2">rad</text>
          <view className="fd-row" style={containerStyle}>
            {radProperties.map((item, index) => (
              <view style={columnStyle} className="fd-col mg5" key={item}>
                <text className="h4 mgl15">{item}</text>
                <view flatten={false} style={getAnimationStyle(index, playState)} className="ani-size mg5" />
              </view>
            ))}
          </view>
        </view>
        <view className="sep"></view>

        <view className="fd-col group pd5">
          <text className="button h2">turn</text>
          <view className="fd-row" style={containerStyle}>
            {turnProperties.map((item, index) => (
              <view style={columnStyle} className="fd-col mg5" key={item}>
                <text className="h4 mgl15">{item}</text>
                <view flatten={false} style={getAnimationStyle(index, playState)} className="ani-size mg5" />
              </view>
            ))}
          </view>
        </view>
        <view className="sep"></view>
      </scroll-view>
    </view>
  );
};

root.render(<AnimationPlayState />);

```

v0.11.0



## Syntax

```css
/* Single animation */
animation-play-state: running;
animation-play-state: paused;

/* Multiple animations */
animation-play-state: paused, running, running;
```

## Formal definition

| Initial value | running |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal syntax

```css
/*default value:running*/
animation-play-state: running | paused;
```

## See also

- [animation](/next/api/css/properties/animation.md)
- [animation-name](/next/api/css/properties/animation-name.md)
- [animation-duration](/next/api/css/properties/animation-duration.md)
- [animation-timing-function](/next/api/css/properties/animation-timing-function.md)
- [animation-delay](/next/api/css/properties/animation-delay.md)
- [animation-iteration-count](/next/api/css/properties/animation-iteration-count.md)
- [animation-direction](/next/api/css/properties/animation-direction.md)
- [animation-fill-mode](/next/api/css/properties/animation-fill-mode.md)
- [animation-play-state](/next/api/css/properties/animation-play-state.md)
- [CSS animation event](/next/api/lynx-api/event/animation-event.md)
- [Animated API](/next/api/lynx-api/lynx/lynx-animate-api.md)

## Compatibility

**Compatibility Table**

**Query:** `css.properties.animation-play-state`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/72-animation-play-state.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| animation-play-state | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`animation-play-state`**

**Specifications:**

