Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit 0368652

Browse files
committed
Update README.md
1 parent 2494307 commit 0368652

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Highly customizable header, body, and footer
77

88
Try out demo here https://codesandbox.io/s/react-unimodal-hvbp1i
99

10-
install
10+
#### install
1111
```
1212
npm i --save react-unimodal
1313
```
1414

1515
add `import 'react-unimodal/dist/style.css';` to your app.js file to use default styles, don't import if you want to style it yourself
1616

17-
creating modal
17+
#### creating modal
1818
```javascript
1919
import { useUniModal } from 'react-unimodal'
2020
// in any page/component, use useUniModal hook to create the component
@@ -29,7 +29,7 @@ function App() {
2929
)
3030
}
3131
```
32-
using modal
32+
#### using modal
3333
```javascript
3434
// use these commands to control the modal
3535
import { showModal, hideModal, updateModal } from 'react-unimodal'
@@ -53,34 +53,35 @@ const Component = () => {
5353
}
5454
```
5555

56-
params to pass
56+
#### params to pass
5757

5858
useUniModal
5959
- object
6060
- id: optional, id of modal, default is used if not set
6161
- header: optional, header component of modal
6262
- body: body component of modal
6363
- footer: optional, footer component of modal
64+
- dom node (optional, used for portal)
6465

65-
example
66+
#### example
6667

6768
`useUniModal({ id: 'modal id', header, body, footer })` or `useUniModal({ header, body, footer })`
6869

6970
header, body, footer can be a react element or string
7071

71-
using portal
72+
#### using portal
7273
`useUniModal(config, portalDomNode)`
7374
modal will be rendered inside portalDomNode instead of application tree
7475

75-
showModal
76+
#### showModal
7677
- call this function to display modal
7778
- id: optional, default is used if not set
7879

79-
hideModal
80+
#### hideModal
8081
- call this function to hide modal
8182
- id: optional, id of modal, default is used if not set
8283

83-
updateModal
84+
#### updateModal
8485
- pass a configuration to change header, body, or footer of a modal, same as `useUniModal`
8586
- object
8687
- id: optional, id of modal, default is used if not set

0 commit comments

Comments
 (0)