Skip to content

Commit dc44ff2

Browse files
committed
Updated README
1 parent f9139a7 commit dc44ff2

File tree

1 file changed

+2
-109
lines changed

1 file changed

+2
-109
lines changed

README.md

Lines changed: 2 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -15,116 +15,9 @@ An elegant Toast solution for react-native apps. Built using Typescript, hooks a
1515
<img alt="Demo" src="./demo.gif" />
1616
</p>
1717

18-
## 🌟 Motivation
18+
## 📚 Docs
1919

20-
I've been working on React-Native projects for a long time and I use toast very often, but I still haven't found a library that is flexible enough for handling toasts. So, I decided to work on this to build a flexible and functional Toast library powerful like [react-toastify](https://github.com/fkhadra/react-toastify)
21-
22-
## ⬇️ Installation
23-
24-
```bash
25-
yarn add react-native-rooster styled-components
26-
```
27-
28-
or
29-
30-
```bash
31-
npm i react-native-rooster styled-components
32-
```
33-
34-
## 🛠 How it works
35-
36-
First, you need to import and wrap your application within ToastProvider:
37-
38-
```javascript
39-
import { ToastProvider } from 'react-native-rooster';
40-
41-
<ToastProvider>
42-
{...}
43-
</ToastProvider>
44-
```
45-
46-
Now you can use our hooks to show your toasts:
47-
48-
```javascript
49-
import { useToast } from 'react-native-rooster';
50-
51-
addToast({
52-
type: 'success', //optional - default: info
53-
title: 'Error', //optional - default: none
54-
message: 'An error ocurred'
55-
})
56-
```
57-
58-
## 🔗 API
59-
60-
### ToastProvider
61-
62-
It is the provider which controls displaying new toasts
63-
64-
### addToast([params](./src/@types/toast.d.ts))
65-
66-
Will show a new toast based on given parameters. Also, it will automatically disappear after 3 seconds on the screen.
67-
68-
### removeToast()
69-
70-
Removes the last toast from screen.
71-
72-
### setToastConfig([params](./src/@types/config.d.ts))
73-
74-
You can change some configs globally. Right now, we only support `bgColor` for each type of toast. The default colors for each type of toast are:
75-
76-
- ![#7890f0](https://via.placeholder.com/15/7890f0/000000?text=+) Info: #7890f0
77-
78-
- ![#35d0ba](https://via.placeholder.com/15/35d0ba/000000?text=+) Success: #35d0ba
79-
80-
- ![#ff9100](https://via.placeholder.com/15/ff9100/000000?text=+) Warning: #ff9100
81-
82-
- ![#d92027](https://via.placeholder.com/15/d92027/000000?text=+) Error: #d92027
83-
84-
85-
For example:
86-
87-
```javascript
88-
import { setToastConfig } from 'react-native-rooster';
89-
90-
setToastConfig({
91-
bgColor: {
92-
success: 'olive',
93-
},
94-
})
95-
```
96-
97-
## 📦 Features
98-
99-
- [x] Automatically keyboard listener. If keyboard is open the toast will not be hidden by it
100-
101-
- [x] Support for different types of toasts (success, info, warning)
102-
- [ ] Support for different positions (top, center, top-left, top-right and so on...)
103-
- [ ] Support for icons
104-
- [ ] Support for multiple toasts being shown at the same time
105-
- [ ] Support for toasts be used inside regular functions not only components' functions
106-
107-
Have more ideas? Put it here!
108-
109-
## 🤝 Contributing
110-
111-
You can clone this repository and just run:
112-
113-
```bash
114-
yarn localPublish
115-
```
116-
117-
After that, you can run the example project inside [example](./example)
118-
119-
### Changing Toast's code
120-
121-
Every change you do in the Toast component you must run again:
122-
123-
```bash
124-
yarn localPublish
125-
```
126-
127-
It will release a new Toast's local version and install it automatically in the example project
20+
Check out the docs [here](https://mcodex.dev/react-native-rooster) for installation and usages instructions
12821

12922
<hr/>
13023
Pull requests are always welcome ❤️

0 commit comments

Comments
 (0)