@empathyco/x-components
Version:
Empathy X Components
61 lines (31 loc) • 1.13 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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: HTMLElement) => void;
cleanUpAnimationStyles: (element: HTMLElement) => void;
collapse: (element: HTMLElement) => 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: HTMLElement) => void; cleanUpAnimationStyles: (element: HTMLElement) => void; collapse: (element: HTMLElement) => void; }
Composable for the module.