Chakra exports four components Fade
, ScaleFade
, Slide
, and SlideFade
to
provide simple transitions.
Most transition components are made using framer-motion
. They accept the
following props:
motion
elementsin
prop used to trigger the transitionunmountOnExit
prop used to unmount the component when it is not visible.The Collapse component is used to create regions of content that can expand/collapse with a simple animation. It helps to hide content that's not immediately relevant to the user.
The transition components extends the framer-motion.
Name | Type | Description | Default |
---|---|---|---|
in | boolean | Show the component; triggers the enter or exit states | - |
unmountOnExit | boolean | If `true`, the element will unmount when `in={false}` and animation is done | - |
Name | Type | Description | Default |
---|---|---|---|
in | boolean | Show the component; triggers the enter or exit states | - |
initialScale | number | The initial scale of the element | 0.95 |
reverse | boolean | If `true`, the element will transition back to exit state | - |
unmountOnExit | boolean | If `true`, the element will unmount when `in={false}` and animation is done | - |
Name | Type | Description | Default |
---|---|---|---|
direction | "top" | "right" | "bottom" | "left" | The direction to slide from | "right" |
in | boolean | Show the component; triggers the enter or exit states | - |
unmountOnExit | boolean | If `true`, the element will unmount when `in={false}` and animation is done | - |
Name | Type | Description | Default |
---|---|---|---|
in | boolean | If `true`, the content will animate in | - |
offsetX | string | number | The offset on the horizontal or `x` axis | 0 |
offsetY | string | number | The offset on the vertical or `y` axis | 8 |
reverse | boolean | If `true`, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out | true |
unmountOnExit | boolean | If `true`, the element will unmount when `in={false}` and animation is done | - |
Name | Type | Description | Default |
---|---|---|---|
animateOpacity | boolean | If `true`, the opacity of the content will be animated | true |
endingHeight | string | number | The height you want the content in its expanded state. | "auto" |
in | boolean | If `true`, the content will be expanded | - |
startingHeight | string | number | The height you want the content in its collapsed state. | 0 |
unmountOnExit | boolean | If `true`, the element will unmount when `in={false}` and animation is done | - |