Skip to content

Commit c83c8e5

Browse files
committed
docs(transitions): Add transition example to readme
1 parent b7c2bd1 commit c83c8e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ yarn add react-simple-hook-modal
2929
- This will not render anything to the DOM here
3030
- Modals are rendered after allthe children in side `<ModalProvider/>`
3131
- Use the `useModal` hook to control your modal's state
32+
- Use the `ModalTransition` enum to optionally set the transition animation
33+
- Currently there are 3 to select from, or choose NONE to disable the transitions
3234

3335
```
34-
import { ModalProvider, Modal, useModal } from 'react-simple-hook-modal';
36+
import { ModalProvider, Modal, useModal, ModalTransition } from 'react-simple-hook-modal';
3537
3638
const MyComponent = () => {
3739
const { isModalOpen, openModal, closeModal } = useModal();
@@ -46,6 +48,7 @@ const MyComponent = () => {
4648
<button onClick={openModal}>Open</button>
4749
)}
4850
isOpen={isModalOpen}
51+
transition={ModalTransition.BOTTOM_UP}
4952
/>
5053
</>
5154
);

0 commit comments

Comments
 (0)