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

# transition-delay

APISummary
## 介绍

用于设置过渡动画延迟执行的时间

## 使用示例

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

**Entry:** `src/transition-delay`
**Bundle:** `dist/transition-delay.lynx.bundle`

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

const TransitionDelay = () => {
  const [flag, setFlag] = useState(false);

  const baseStyle = {
    opacity: flag ? "1" : "0.1" as const,
    width: flag ? "100px" : "200px",
    height: flag ? "100px" : "200px",
    backgroundColor: flag ? "blue" : "red",
    visibility: (flag ? "visible" : "hidden") as "visible" | "hidden",
    top: flag ? "0px" : "50px",
    right: flag ? "0px" : "50px",
    bottom: flag ? "0px" : "50px",
    left: flag ? "0px" : "50px",
    transform: flag ? "translateX(0px)" : "translateX(50px)" as const,
  };

  return (
    <scroll-view scroll-orientation="vertical" className="scroll">
      <view className="base" bindtap={() => setFlag(!flag)}>
        <text>Click to transition</text>
      </view>
      <view
        className="base allTransition"
        style={{
          opacity: baseStyle.opacity,
          width: baseStyle.width,
          height: baseStyle.height,
          backgroundColor: baseStyle.backgroundColor,
        }}
      >
        <text>No delay animation</text>
      </view>
      <view
        className="base allTransition"
        style={{
          opacity: baseStyle.opacity,
          width: baseStyle.width,
          height: baseStyle.height,
          backgroundColor: baseStyle.backgroundColor,
          transitionDelay: "1s" as const,
        }}
      >
        <text>1s delay animation</text>
      </view>
      <view
        className="base allTransition"
        style={{
          opacity: baseStyle.opacity,
          width: baseStyle.width,
          height: baseStyle.height,
          backgroundColor: baseStyle.backgroundColor,
          transitionDelay: "2s" as const,
        }}
      >
        <text>2s delay animation</text>
      </view>
      <view
        className="base allTransition"
        style={{
          opacity: baseStyle.opacity,
          width: baseStyle.width,
          height: baseStyle.height,
          backgroundColor: baseStyle.backgroundColor,
          transitionDelay: "3s" as const,
        }}
      >
        <text>3s delay animation</text>
      </view>
    </scroll-view>
  );
};

root.render(<TransitionDelay />);

```

v0.11.0



## 语法

```css
transition-delay: 2s;
transition-delay: 300ms;
```

### 取值

- [`<time>`](/next/zh/api/css/data-type/time.md)
  延迟时间。
- 默认值
  **0s**

## 形式定义

| 初始值 | 0 |
| 适用元素 | 所有元件 |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```
transition-delay:`<time>`;
```

## 扩展阅读

- [transition-property](/next/zh/api/css/properties/transition-property.md)
- [transition-duration](/next/zh/api/css/properties/transition-duration.md)
- [transition](/next/zh/api/css/properties/transition.md)
- [transition-timing-function](/next/zh/api/css/properties/transition-timing-function.md)
- [CSS 动画事件](/next/zh/api/lynx-api/event/animation-event.md)

## 注意事项

:::info

- Lynx 默认 `duration` 和 `delay` 需要**有单位**，强烈建议带上单位。

:::

## 兼容性

**Compatibility Table**

**Query:** `css.properties.transition-delay`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| transition-delay | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`transition-delay`**

**Specifications:**

