echo-toast 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# A simple toast component for React/Next.JS
|
|
1
|
+
# A simple lightweight toast component for React/Next.JS (under 2kb)
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
@@ -14,7 +14,21 @@ npm install echo-toast
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
Import the
|
|
17
|
+
Import the css file on your main file of React.
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// main.tsx
|
|
21
|
+
|
|
22
|
+
import { createRoot } from "react-dom/client";
|
|
23
|
+
import YourApp from '@/app.tsx'
|
|
24
|
+
import 'echo-toast/styles.css'
|
|
25
|
+
|
|
26
|
+
const container = document.getElementById('root')
|
|
27
|
+
|
|
28
|
+
createRoot(container!).render(<YourApp />)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Import the **<Toaster />** component to your page/component.
|
|
18
32
|
|
|
19
33
|
```js
|
|
20
34
|
// Home.tsx
|
|
@@ -32,6 +46,8 @@ export function Home() {
|
|
|
32
46
|
}
|
|
33
47
|
```
|
|
34
48
|
|
|
49
|
+
Then you can use the **echo.notify()** from anywhere in your app so you can render each toast notification.
|
|
50
|
+
|
|
35
51
|
```js
|
|
36
52
|
// SuperButton.tsx
|
|
37
53
|
|