浏览代码

docs: detailed the various options that can be used

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 年之前
父节点
当前提交
704f737dc6
共有 1 个文件被更改,包括 13 次插入2 次删除
  1. 13 2
      README.md

+ 13 - 2
README.md

@@ -23,6 +23,9 @@
 ```js
 import Toast from "toasters";
 
+new Toast(options);
+
+// example
 new Toast({
   content: "Hello World",
   persistent: true
@@ -31,11 +34,19 @@ new Toast({
 
 **Preview:**
 
-![preview of visible toast on webpage](https://i.imgur.com/7kIH6Oi.png)
+![preview of visible toast on webpage](https://i.imgur.com/UvXaEkD.png)
+
+## Options
+
+| Option | Type | Default | Description |
+| --- | --- | --- | --- |
+| **`content`** | String | `""` | The notification message. |
+| **`persistent`** | Boolean | `false` | Whether or not the toast is persistent. |
+| **`interactable`** | Boolean | `true` | If the toast can be manually closed or not. |
+| **`timeout`** | Number | `6000` | How long till the toast disappears. *Note: will be ignored if the toast is persistent.* |
 
 ## Potential future additions
 
-- Design improvements
 - Error handling (i.e. you haven't provided any content for the toast)
 - Ability to parse markdown or html