Homelogologo
Sponsor

Presence

A utility component that manages the enter and exit animations of its children.

Usage

Used to manage the mounting and unmounting of components with animations. It tracks the animation and transition states of its children to ensure they are fully animated out before being hidden or unmounted.

import { Presence } from "@elemnts-ui/react" <Presence present={present}> <div>Content to animate</div> </Presence>

Examples

Unmount on Exit

Use the unmountOnExit prop to completely remove the component from the DOM when it's not present.

Lazy Mounting

Use the lazyMount prop to defer rendering the component until the first time present is true.

API Reference

PropTypeDefault
presentbooleanfalse
lazyMountbooleanfalse
unmountOnExitbooleanfalse
onExitComplete() => void-