aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/5.0/components/modal.md
diff options
context:
space:
mode:
Diffstat (limited to 'site/content/docs/5.0/components/modal.md')
-rw-r--r--site/content/docs/5.0/components/modal.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/site/content/docs/5.0/components/modal.md b/site/content/docs/5.0/components/modal.md
index e6a838aac..56fad0297 100644
--- a/site/content/docs/5.0/components/modal.md
+++ b/site/content/docs/5.0/components/modal.md
@@ -831,11 +831,20 @@ The modal plugin toggles your hidden content on demand, via data attributes or J
### Via data attributes
+#### Toggle
+
Activate a modal without writing JavaScript. Set `data-bs-toggle="modal"` on a controller element, like a button, along with a `data-bs-target="#foo"` or `href="#foo"` to target a specific modal to toggle.
```html
<button type="button" data-bs-toggle="modal" data-bs-target="#myModal">Launch modal</button>
```
+#### Dismiss
+
+{{% js-dismiss "modal" %}}
+
+{{< callout warning >}}
+While both ways to dismiss a modal are supported, keep in mind that dismissing from outside a modal does not match [the WAI-ARIA modal dialog design pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal). Do this at your own risk.
+{{< /callout >}}
### Via JavaScript