@edinelsonslima/toast-notification 0.0.24 → 0.0.25
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 +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## ⤵️ Instalando
|
|
4
4
|
|
|
5
|
+
Adicionar com **yarn**
|
|
5
6
|
```
|
|
6
7
|
yarn add @edinelsonslima/toast-notification
|
|
7
8
|
```
|
|
9
|
+
Adicionar com **npm**
|
|
8
10
|
```
|
|
9
11
|
npm install @edinelsonslima/toast-notification
|
|
10
12
|
```
|
|
@@ -36,7 +38,7 @@ import { toast } from '@edinelsonslima/toast-notification';
|
|
|
36
38
|
export default function MyComponent(){
|
|
37
39
|
//seu código
|
|
38
40
|
|
|
39
|
-
const
|
|
41
|
+
const exampleToast = () => {
|
|
40
42
|
toast.success({ text: "Mensagem de exemplo" })
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -69,23 +71,23 @@ export default function MyComponent(){
|
|
|
69
71
|
| propriedade |tipo | é obrigatório | padrão |
|
|
70
72
|
|-------------|-------|-----------------|-------------|
|
|
71
73
|
| text |string | sim | - |
|
|
72
|
-
| type |string | sim | - |
|
|
74
|
+
| type |string | sim | - |
|
|
73
75
|
| duration |number | não | 7_0000 |
|
|
74
76
|
| classNames |object | não | undefined |
|
|
75
77
|
| position |string | não | right-top |
|
|
76
78
|
|
|
77
|
-
ℹ️ O `
|
|
79
|
+
ℹ️ O `duration` está em ms (milissegundos)
|
|
78
80
|
|
|
79
81
|
|
|
80
82
|
ℹ️ A função `toast` pode ser chamada de duas forma, veja os exemplos a seguir:
|
|
81
83
|
|
|
82
84
|
caso seja chamada direta, será obrigatório informa o **type**
|
|
83
85
|
```ts
|
|
84
|
-
toast({ text: "mensagem exemplo", type: "info",
|
|
86
|
+
toast({ text: "mensagem exemplo", type: "info", duration: 1000 * 4 })
|
|
85
87
|
```
|
|
86
88
|
ou pode acessar o tipo do toast diretamente, assim omitindo ele do objeto enviado
|
|
87
89
|
```ts
|
|
88
|
-
toast.info({ text: "mensagem exemplo",
|
|
90
|
+
toast.info({ text: "mensagem exemplo", durantino: 1000 * 4 })
|
|
89
91
|
```
|
|
90
92
|
|
|
91
93
|
|