> 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-direction

APISummary
## Introduction

`animation-direction` property specifies whether the animation should play in reverse.

## Examples

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

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

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

const AnimationDirection = () => {
  const directionProperties = ["normal", "reverse", "alternate", "alternate-reverse"];

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

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

  const getAnimationStyle = (direction: string) => ({
    animation: `ani 1.5s ease 0s infinite ${direction} forwards running` as const,
  });

  return (
    <scroll-view scroll-orientation="vertical" className="fd-col container">
      <text className="h1">keyframes animation demo: direction</text>
      <view className="sep"></view>

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

root.render(<AnimationDirection />);

```

v0.11.0



## Syntax

```css
animation-direction: normal
animation-direction: reverse
animation-direction: alternate
animation-direction: alternate-reverse
animation-direction: normal, reverse
animation-direction: alternate, reverse, normal

```

### Values

#### normal

The animation plays forward in each cycle. In other words, each animation cycle ends and resets to the starting point to begin again. This is the default behavior.

#### alternate

The animation alternates between running forwards and backwards. When running backwards, the animation steps backward and timing functions are also reversed. For example, ease-in becomes ease-out when reversed.

#### reverse

The animation runs backwards, playing from end to start.

#### alternate-reverse

The animation runs backwards on the first iteration, then forwards on the next, and continues alternating.

## Formal definition

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


## Formal syntax

```css
/*default value: normal*/
animation-direction: normal | reverse | alternate | alternate-reverse;
```

## 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-direction`

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

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

**`animation-direction`**

**Specifications:**

