---
name: "Animation.height"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "Animation.height - 设置高度"
---

## Animation.height

> [VERSION] Base Library >= 2.21.8

### Description

Set height

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `value` | `string \| number` | Yes | Height value; if a number is passed, px is used by default |

### Return Value

Type: `Animation`

Animation instance

### Examples

#### Set height

```ts
Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.height(300).step();
    this.setData({ animationData: animation.export() });
  },
});
```
