You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix StackBlitz Popovers and Tooltips examples (#36449)
* Fix StackBlitz Popovers and Tooltips examples
* Rename shortcode example parameters
* Reorder example shortcode doc params + fix Cspell
* Remove 'stackblitz' param + use data-bs-title instead of title
* Update site/layouts/partials/callout-warning-data-bs-title-vs-title.md
Co-authored-by: Mark Otto <[email protected]>
Co-authored-by: Mark Otto <[email protected]>
Copy file name to clipboardExpand all lines: site/content/docs/5.2/components/modal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -444,7 +444,7 @@ Have a bunch of buttons that all trigger the same modal with slightly different
444
444
445
445
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
446
446
447
-
{{< example js_snippet="true" >}}
447
+
{{< example stackblitz_add_js="true" >}}
448
448
<buttontype="button"class="btn btn-primary"data-bs-toggle="modal"data-bs-target="#exampleModal"data-bs-whatever="@mdo">Open modal for @mdo</button>
449
449
<buttontype="button"class="btn btn-primary"data-bs-toggle="modal"data-bs-target="#exampleModal"data-bs-whatever="@fat">Open modal for @fat</button>
450
450
<buttontype="button"class="btn btn-primary"data-bs-toggle="modal"data-bs-target="#exampleModal"data-bs-whatever="@getbootstrap">Open modal for @getbootstrap</button>
We use JavaScript similar to the snippet above to render the following live popover. Titles are set via `title` attribute and body content is set via `data-bs-content`.
47
+
We use JavaScript similar to the snippet above to render the following live popover. Titles are set via `data-bs-title` and body content is set via `data-bs-content`.
<buttontype="button"class="btn btn-lg btn-danger"data-bs-toggle="popover"title="Popover title"data-bs-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
51
55
{{< /example >}}
52
56
53
57
### Four directions
54
58
55
59
Four options are available: top, right, bottom, and left. Directions are mirrored when using Bootstrap in RTL. Set `data-bs-placement` to change the direction.
data-bs-content="This popover is themed via CSS variables.">
96
100
Custom popover
97
101
</button>
@@ -107,8 +111,8 @@ Use the `focus` trigger to dismiss popovers on the user's next click of a differ
107
111
For proper cross-browser and cross-platform behavior, you must use the `<a>` tag, _not_ the `<button>` tag, and you also must include a [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) attribute.
108
112
{{< /callout >}}
109
113
110
-
{{< example js_snippet="true" >}}
111
-
<atabindex="0"class="btn btn-lg btn-danger"role="button"data-bs-toggle="popover"data-bs-trigger="focus"title="Dismissible popover"data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
114
+
{{< example stackblitz_add_js="true" >}}
115
+
<atabindex="0"class="btn btn-lg btn-danger"role="button"data-bs-toggle="popover"data-bs-trigger="focus"data-bs-title="Dismissible popover"data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
112
116
{{< /example >}}
113
117
114
118
```js
@@ -123,7 +127,7 @@ Elements with the `disabled` attribute aren't interactive, meaning users cannot
123
127
124
128
For disabled popover triggers, you may also prefer `data-bs-trigger="hover focus"` so that the popover appears as immediate visual feedback to your users as they may not expect to _click_ on a disabled element.
Copy file name to clipboardExpand all lines: site/content/docs/5.2/components/toasts.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ Building on the above example, you can create different toast color schemes with
197
197
198
198
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`.
{{< example class="tooltip-demo" js_snippet="true" >}}
49
-
<pclass="muted">Placeholder text to demonstrate some <ahref="#"data-bs-toggle="tooltip"title="Default tooltip">inline links</a> with tooltips. This is now just filler, no killer. Content placed here just to mimic the presence of <ahref="#"data-bs-toggle="tooltip"title="Another tooltip">real text</a>. And all that just to give you an idea of how tooltips would look when used in real-world situations. So hopefully you've now seen how <ahref="#"data-bs-toggle="tooltip"title="Another one here too">these tooltips on links</a> can work in practice, once you use them on <ahref="#"data-bs-toggle="tooltip"title="The last tip!">your own</a> site or project.
48
+
{{< example class="tooltip-demo" stackblitz_add_js="true" >}}
49
+
<pclass="muted">Placeholder text to demonstrate some <ahref="#"data-bs-toggle="tooltip"data-bs-title="Default tooltip">inline links</a> with tooltips. This is now just filler, no killer. Content placed here just to mimic the presence of <ahref="#"data-bs-toggle="tooltip"data-bs-title="Another tooltip">real text</a>. And all that just to give you an idea of how tooltips would look when used in real-world situations. So hopefully you've now seen how <ahref="#"data-bs-toggle="tooltip"data-bs-title="Another one here too">these tooltips on links</a> can work in practice, once you use them on <ahref="#"data-bs-toggle="tooltip"data-bs-title="The last tip!">your own</a> site or project.
Feel free to use either `title` or `data-bs-title` in your HTML. When `title` is used, Popper will replace it automatically with `data-bs-title` when the element is rendered.
<buttontype="button" class="btn-edit text-nowrap"{{with$js_snippet}}data-js-snippet="{{ $js_snippet }}"{{end}}title="Try it on StackBlitz">
33
+
<buttontype="button" class="btn-edit text-nowrap"{{with$stackblitz_add_js}}data-sb-js-snippet="{{ $stackblitz_add_js }}"{{end}}title="Try it on StackBlitz">
0 commit comments