# motion/layout-animating (zidane-ui)

Import: `import { … } from 'zidane-ui'`. Source: [ui/src/motion/layout-animating.ts](https://github.com/Tahul/zidane/blob/main/ui/src/motion/layout-animating.ts).

## Functions

### `beginLayoutAnimation`

Function.

Marks a layout animation as started; call the returned function (idempotent) when it ends.

```ts
function beginLayoutAnimation(): () => void
```

**Returns** `() => void`

Source: [ui/src/motion/layout-animating.ts:34](https://github.com/Tahul/zidane/blob/main/ui/src/motion/layout-animating.ts#L34)

### `isLayoutAnimating`

Function.

True while at least one layout animation runs.

```ts
function isLayoutAnimating(): boolean
```

**Returns** `boolean`

Source: [ui/src/motion/layout-animating.ts:17](https://github.com/Tahul/zidane/blob/main/ui/src/motion/layout-animating.ts#L17)

### `pulseLayout`

Function.

Something moved without animating (an element reparented): followers measure for the next two frames.

```ts
function pulseLayout(): void
```

Source: [ui/src/motion/layout-animating.ts:47](https://github.com/Tahul/zidane/blob/main/ui/src/motion/layout-animating.ts#L47)

### `subscribeLayoutAnimating`

Function.

Listens for layout animations starting and stopping; returns the unsubscribe.

```ts
function subscribeLayoutAnimating(cb: () => void): () => void
```

**Parameters**

- `cb` (`() => void`): Called whenever the count goes from or to zero; read [`isLayoutAnimating`](https://zidane.si/docs/reference/ui-motion-layout-animating.md#isLayoutAnimating) for which.

**Returns** `() => void`

Source: [ui/src/motion/layout-animating.ts:26](https://github.com/Tahul/zidane/blob/main/ui/src/motion/layout-animating.ts#L26)
