echo-toast 1.0.6 → 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.
Files changed (2) hide show
  1. package/README.md +18 -2
  2. package/package.json +5 -2
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 **<Toaster />** component to your page/component. Then you can use the **echo.notify()** from anywhere in your app so you can render each toast notification.
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "echo-toast",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "type": "module",
6
6
  "main": "./dist/echo-toast.js",
7
7
  "module": "./dist/echo-toast.js",
@@ -48,7 +48,10 @@
48
48
  "types": "./dist/echo-toast.d.ts",
49
49
  "import": "./dist/echo-toast.js"
50
50
  },
51
- "./styles.css": "./dist/echo-toast.css"
51
+ "./styles.css": {
52
+ "default": "./dist/echo-toast.css",
53
+ "types": "./dist/echo-toast.d.ts"
54
+ }
52
55
  },
53
56
  "files": [
54
57
  "dist"