<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [useCollapseAnimation](./x-components.usecollapseanimation.md)

## useCollapseAnimation() function

Returns parametrized methods to use in a component to allow the collapsing of the provided property.

**Signature:**

```typescript
export declare function useCollapseAnimation(property: AnimatedProperty): {
    expand: (element: Element) => void;
    cleanUpAnimationStyles: (element: Element) => void;
    collapse: (element: Element) => void;
};
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

property


</td><td>

AnimatedProperty


</td><td>

The property that will be animated.


</td></tr>
</tbody></table>

**Returns:**

{ expand: (element: Element) =&gt; void; cleanUpAnimationStyles: (element: Element) =&gt; void; collapse: (element: Element) =&gt; void; }

Composable for the module.

