```js // @noErrors import { flip } from 'svelte/animate'; ``` ## flip The flip function calculates the start and end position of an element and animates between them, translating the x and y values. `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).
```dts function flip( node: Element, { from, to }: { from: DOMRect; to: DOMRect; }, params?: FlipParams ): AnimationConfig; ```
## AnimationConfig
```dts interface AnimationConfig {/*…*/} ```
```dts delay?: number; ```
```dts duration?: number; ```
```dts easing?: (t: number) => number; ```
```dts css?: (t: number, u: number) => string; ```
```dts tick?: (t: number, u: number) => void; ```
## FlipParams
```dts interface FlipParams {/*…*/} ```
```dts delay?: number; ```
```dts duration?: number | ((len: number) => number); ```
```dts easing?: (t: number) => number; ```