UI kit reference
motion/collapse
import { … } from 'zidane-ui'ui/src/motion/collapse.ts
Functions#
useStaysMountedFunction#
open, held true until a .zg-collapsible has finished closing. Content
rendered only while open ({open && …}) vanishes on the first frame of a
close: the collapse animates an empty box while everything below jumps up.
Render it while this is true instead: it mounts at once on open and
unmounts once the collapse has played (readExitMs(), read when the close
starts: at once with motion off).
function useStaysMounted(open: boolean): booleanParameters
| Name | Type | Description |
|---|---|---|
| open | boolean | Whether the collapsible is open. |
Returns
booleantrue while it is open or still playing its close.