diff options
author | Mark Otto <markd.otto@gmail.com> | 2021-01-18 16:10:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 16:10:01 +0300 |
commit | 4167c107f81aeb2b05e3fe3e2e511b50ea9be640 (patch) | |
tree | fdb0dc559e16c465081dd7512f2e828032732c3c /site/content | |
parent | bb19b08fbe41157c5a6e8238ecefda064adda318 (diff) |
Add a live toast example to the docs (#32760)
Diffstat (limited to 'site/content')
-rw-r--r-- | site/content/docs/5.0/components/toasts.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/site/content/docs/5.0/components/toasts.md b/site/content/docs/5.0/components/toasts.md index 45cef6f453..eb879b6500 100644 --- a/site/content/docs/5.0/components/toasts.md +++ b/site/content/docs/5.0/components/toasts.md @@ -41,6 +41,46 @@ Toasts are as flexible as you need and have very little required markup. At a mi </div> {{< /example >}} +### Live + +Click the button the below to show as toast (positioning with our utilities in the lower right corner) that has been hidden by default with `.hide`. + +<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 5"> + <div id="liveToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true"> + <div class="toast-header"> + {{< placeholder width="20" height="20" background="#007aff" class="rounded me-2" text="false" title="false" >}} + <strong class="me-auto">Bootstrap</strong> + <small>11 mins ago</small> + <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> + </div> + <div class="toast-body"> + Hello, world! This is a toast message. + </div> + </div> +</div> + +<div class="bd-example"> + <button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button> +</div> + +```html +<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button> + +<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 5"> + <div id="liveToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true"> + <div class="toast-header"> + <img src="..." class="rounded me-2" alt="..."> + <strong class="me-auto">Bootstrap</strong> + <small>11 mins ago</small> + <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> + </div> + <div class="toast-body"> + Hello, world! This is a toast message. + </div> + </div> +</div> +``` + ### Translucent Toasts are slightly translucent, too, so they blend over whatever they might appear over. |