1.0.9 • Published 1 year ago
@edmaralencar/modal v1.0.9
@edmaralencar/modal
Github: https://github.com/edmaaralencar/react-modal
Installation
- Use
yarn add @edmaralencar/modal
ornpm install @edmaralencar/modal
Description
This library is made with Framer Motion and Radix UI (React Dialog) and it simplifies the building of a modal with animations.
Usage
To use, you have to followe the instructions down below:
OBS: The Modal component can only have 1 direct children, which its gonna receive all the animations.
- Import the Modal component;
- There is also ModalTitle, ModalDescription and ModalClose, which all of them are the same as the Radix UI ones.
- Pass the props: - children: This is the modal content itself. - open: current state of modal (if true, the modal is open, else is closed). - onOpenChange: function that changes the current state of modal. - variant (optional): it comes with a default animation, but you can change it using this props - it has to follow the current structure: - backgroundOpacity (optional) (values can be 0 to 1): changes the background opacity.
- Build your own modal.