diff --git a/packages/web/src/scss/components/Toast/README.md b/packages/web/src/scss/components/Toast/README.md index 72d64e3aaf..331c5e68eb 100644 --- a/packages/web/src/scss/components/Toast/README.md +++ b/packages/web/src/scss/components/Toast/README.md @@ -6,6 +6,8 @@ Toast is a composition of a few subcomponents: - [Toast](#toast) - [ToastBar](#toastbar) + - [ToastBarMessage](#toastbarmessage) + - [ToastBarLink](#toastbarlink) ## JavaScript Plugin @@ -164,8 +166,10 @@ Minimum example: ```html
-
-
Message only
+
+
+
Message only
+
@@ -178,33 +182,75 @@ An icon can be added to the ToastBar component: ```html
-
+
-
Message with icon
+
+
Message with icon
+
+
+
+
+``` + +### ToastBar Components + +The content of `ToastBar` can be assembled from the following components: + +#### ToastBarMessage + +`ToastBarMessage` is a component designates for main message in `ToastBar`. + +Usage example: + +```html +
+
+
+
+
Message with action
+
``` -### Action Link +#### API + +| Name | Type | Default | Required | Description | +| ---------- | -------- | ------- | -------- | ------------------------------ | +| `children` | `string` | — | ✔ | Content of the ToastBarMessage | + +#### ToastBarLink -An action link can be added to the ToastBar component: +`ToastBarLink` is a component designated to create an action link within `ToastBar`. + +Usage example: ```html
-
-
- Message with action - Action +
+
+
Message with action
+ Action
``` +#### API + +| Name | Type | Default | Required | Description | +| -------------- | ------------------------------------------------ | ---------- | -------- | ------------------------------ | +| `children` | `string` | — | ✔ | Content of the ToastBarLink | +| `color` | [Action Link Color dictionary][dictionary-color] | `inverted` | ✕ | Color of the link | +| `href` | `string` | — | ✕ | ToastBarLink's href attribute | +| `isDisabled` | `bool` | `false` | ✕ | Whether is the link disabled | +| `isUnderlined` | `bool` | `true` | ✕ | Whether is the link underlined | + 👉 **Do not put any important actions** like "Undo" in the ToastBar component (unless there are other means to perform said action), as it is very hard (if not impossible) to reach for users with assistive technologies. Read more about [Toast accessibility][scott-o-hara-toast] at Scott O'Hara's blog. @@ -219,8 +265,10 @@ For example: ```html
-
-
Success message
+
+
+
Success message
+
@@ -256,7 +304,7 @@ button: ```html
-
+
Dismissible message