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

# animation-timing-function

APISummary
## 介绍

`animation-timing-function` 属性定义 CSS 动画在每一动画周期中执行的节奏。可能值为一或多个 [timing-function](https://developer.mozilla.org/zh-CN/docs/Web/CSS/easing-function)。

## 使用示例

**下面是一个示例: css-api**

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

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

const AnimationTimingFunction = () => {
  const timingFunctions = ["linear", "ease", "ease-in", "ease-out", "ease-in-out"];

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

  const getAnimationStyle = (timingFunction: string) => ({
    animation: `ani 3s ${timingFunction} 0s infinite normal forwards running` as const,
  });

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

      {timingFunctions.map(item => (
        <>
          <view className="fd-col group pd5" key={item}>
            <view style={columnStyle} className="fd-col mg5">
              <text className="h4">time functions:{item}</text>
              <view flatten={false} style={getAnimationStyle(item)} className="ani-size mg5" />
            </view>
          </view>
          <view className="sep"></view>
        </>
      ))}
    </scroll-view>
  );
};

root.render(<AnimationTimingFunction />);

```

v0.11.0



## 语法

```css
/* Keyword values */
animation-timing-function: ease;
animation-timing-function: ease-in;
animation-timing-function: ease-out;
animation-timing-function: ease-in-out;
animation-timing-function: linear;

/* Function values */
animation-timing-function: cubic-bezier(0.1, 0.7, 1, 0.1);
animation-timing-function: steps(4, end);

/* Multiple animations */
animation-timing-function: ease, steps(5, end), cubic-bezier(0.1, 0.7, 1, 0.1);
```

## 形式定义

| 初始值 | linear |
| 适用元素 | all elements |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```css
/*默认值linear*/
animation-name: linear | ease | ease-in | ease-out | ease-in-out |
  <timing-function>;
```

## 扩展阅读

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

## 兼容性

**Compatibility Table**

**Query:** `css.properties.animation-timing-function`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/animation-timing-function)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| animation-timing-function | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| linear | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| ease-in | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| ease-out | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| ease-in-ease-out | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | No |
| ease | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| ease-in-out | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| square-bezier | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | No |
| cubic-bezier | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| step-start | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| step-end | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| steps | Yes (1.0) | Unknown | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`animation-timing-function`**

**Specifications:**

**`linear`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`ease-in`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`ease-out`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`ease-in-ease-out`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

- **Web — Not supported:** Uses browser CSS easing functions; Lynx-specific easing names are not translated.

**`ease`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`ease-in-out`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`square-bezier`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

- **Android — From 1.0:** The new animator supports <code>square-bezier()</code> since Lynx 4.0; the non-new animator has supported it since the original version.
- **iOS — From 1.0:** The new animator supports <code>square-bezier()</code> since Lynx 4.0; the non-new animator has supported it since the original version.
- **macOS — From 1.0:** The new animator supports <code>square-bezier()</code> since Lynx 4.0; the non-new animator has supported it since the original version.
- **Windows — From 1.0:** The new animator supports <code>square-bezier()</code> since Lynx 4.0; the non-new animator has supported it since the original version.
- **Web — Not supported:** Uses browser CSS easing functions; Lynx-specific easing names are not translated.

**`cubic-bezier`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`step-start`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`step-end`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

**`steps`**

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/67-animation-timing-function.json)

- **Android — From 1.0:** Lynx requires the second <code>&lt;step-position&gt;</code> argument; unlike Web, <code>steps(n)</code> is invalid. Use <code>steps(n, end)</code> or <code>steps(n, jump-end)</code>.
- **iOS — From 1.0:** Lynx requires the second <code>&lt;step-position&gt;</code> argument; unlike Web, <code>steps(n)</code> is invalid. Use <code>steps(n, end)</code> or <code>steps(n, jump-end)</code>.
- **macOS — From 1.0:** Lynx requires the second <code>&lt;step-position&gt;</code> argument; unlike Web, <code>steps(n)</code> is invalid. Use <code>steps(n, end)</code> or <code>steps(n, jump-end)</code>.
- **Windows — From 1.0:** Lynx requires the second <code>&lt;step-position&gt;</code> argument; unlike Web, <code>steps(n)</code> is invalid. Use <code>steps(n, end)</code> or <code>steps(n, jump-end)</code>.

