From: Mark Otto Date: Thu, 18 Jun 2020 17:27:42 +0000 (-0700) Subject: Add new toasts examples (#30572) X-Git-Tag: v5.0.0-alpha2~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6a9e785b5fe9e0f4843418762d17303de8979d6;p=thirdparty%2Fbootstrap.git Add new toasts examples (#30572) * Add two new toasts examples - Adds a new custom content example that removes the toast header and adds a custom close icon - Adds docs for how to create your own color schemes - Adds example of additional buttons * Update toasts examples - Remove span and place aria on SVG element - Add .border-0 to color scheme example for crisper edges * Update toasts.md Co-authored-by: XhmikosR --- diff --git a/site/content/docs/5.0/components/toasts.md b/site/content/docs/5.0/components/toasts.md index 1fd3f9971e..33b2cba199 100644 --- a/site/content/docs/5.0/components/toasts.md +++ b/site/content/docs/5.0/components/toasts.md @@ -98,6 +98,56 @@ When you have multiple toasts, we default to vertically stacking them in a reada {{< /example >}} +### Custom content + +Customize your toasts by removing sub-components, tweaking with [utilities]({{< docsref "/utilities/api" >}}), or adding your own markup. Here we've created a simpler toast by removing the default `.toast-header`, adding a custom hide icon from [Bootstrap Icons](https://icons.getbootstrap.com), and using some [flexbox utilities]({{< docsref "/utilities/flex" >}}) to adjust the layout. + +{{< example class="bg-light" >}} + +{{< /example >}} + +Alternatively, you can also add additional controls and components to toasts. + +{{< example class="bg-light" >}} + +{{< /example >}} + +### Color schemes + +Building on the above example, you can create different toast color schemes with our [color utilities]({{< docsref "/utilities/colors" >}}). Here we've added `.bg-primary` and `.text-white` to the `.toast`, and then added `.text-white` to our close button. For a crisp edge, we remove the default border with `.border-0`. + +{{< example class="bg-light" >}} + +{{< /example >}} + ## Placement Place toasts with custom CSS as you need them. The top right is often used for notifications, as is the top middle. If you're only ever going to show one toast at a time, put the positioning styles right on the `.toast`.