Skip to content

Commit 07e46dc

Browse files
committed
docs: Fix issues with readme and add more info
1 parent a027595 commit 07e46dc

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Need a simple modal that just works? `react-simple-hook-modal` is just that!
44

5-
![Publish CI][publish] ![CI][ci] [![npm latest][npmBadge]][npmLink]
5+
![Publish CI][publish] ![CI][ci] [![npm latest][npmbadge]][npmlink]
66

77
![react-simple-hook-modal][logo]
88

@@ -15,14 +15,21 @@ npm install react-simple-hook-modal
1515
1616
or
1717
18-
yarn add react-simple
18+
yarn add react-simple-hook-modal
1919
```
2020

2121
# Usage
22+
2223
## React
2324

2425
`react-simple-hook-modal` has a super simple API and utilises React hooks.
2526

27+
- Simply wrap your app in `<ModalProvider/>`
28+
- Add instances of `<Modal/>` wherever you want to display a modal
29+
- This will not render anything to the DOM here
30+
- Modals are rendered after allthe children in side `<ModalProvider/>`
31+
- Use the `useModal` hook to control your modal's state
32+
2633
```
2734
import { ModalProvider, Modal, useModal } from 'react-simple-hook-modal';
2835
@@ -53,12 +60,14 @@ const App = () => (
5360
```
5461

5562
## Styles
63+
5664
`react-simple-hook-modal` uses a subset of [tailwindcss][tailwind] under the hood. The tailwind classes used have a prefix of `rsm` added to avoid potential conflicts with your own styles. You can import the default styles using:
65+
5766
```
58-
import 'react-simple-hook-modal/styles.css';
67+
import 'react-simple-hook-modal/dist/styles.css';
5968
```
60-
`ModalProvider` also takes an optional `backdropClassName` which can contain one or more classes to append and override the default styles (e.g. Changing the backdrop colour can be done by adding the class `bg-blue-800`).
6169

70+
`ModalProvider` also takes an optional `backdropClassName` which can contain one or more classes to append and override the default styles (e.g. Changing the backdrop colour can be done by adding the class `bg-blue-800`).
6271

6372
# Example
6473

@@ -76,12 +85,8 @@ If you have any issues, please create an issue here on GitHub.
7685

7786
[publish]: https://github.com/mbrookson/react-simple-hook-modal/workflows/Publish%20CI/badge.svg?branch=master
7887
[ci]: https://github.com/mbrookson/react-simple-hook-modal/workflows/CI/badge.svg
79-
80-
[npmBadge]: https://img.shields.io/npm/v/react-simple-hook-modal.svg?style=flat-square
81-
[npmLink]: https://npmjs.org/package/react-simple-hook-modal
82-
88+
[npmbadge]: https://img.shields.io/npm/v/react-simple-hook-modal.svg?style=flat-square
89+
[npmlink]: https://npmjs.org/package/react-simple-hook-modal
8390
[logo]: https://raw.githubusercontent.com/mbrookson/react-simple-hook-modal/master/logo.png
84-
8591
[demo]: https://react-simple-hook-modal.now.sh/
86-
87-
[tailwind]: https://tailwindcss.com/
92+
[tailwind]: https://tailwindcss.com/

0 commit comments

Comments
 (0)