> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.createAnimation

> Create an animation instance for element animations.

Use this API to create an animation instance that can be used to define and export animations.

## Parameters

| Property        | Type    | Required | Description                                                                                       |
| --------------- | ------- | -------- | ------------------------------------------------------------------------------------------------- |
| duration        | Integer | No       | Animation duration in ms (default: 400)                                                           |
| timeFunction    | String  | No       | Timing function: `linear`, `ease`, `ease-in`, `ease-in-out`, `ease-out`, `step-start`, `step-end` |
| delay           | Integer | No       | Animation delay in ms (default: 0)                                                                |
| transformOrigin | String  | No       | Transform origin (default: `50% 50% 0`)                                                           |

## Return Value

Returns an Animation object with chainable methods.

## Code Example

```javascript theme={null}
const animation = my.createAnimation({
  duration: 1000,
  timeFunction: 'ease'
});

animation.scale(2).rotate(45).step();

this.setData({
  animationData: animation.export()
});
```

```xml theme={null}
<view animation="{{animationData}}">Animated content</view>
```

## Related APIs

<CardGroup cols={2}>
  <Card title="my.createLottieContext" icon="play" href="/jsapi/media/lottie/my.createLottieContext">
    Create Lottie animation
  </Card>
</CardGroup>
