Use of HTML native <dialog> element for modals, offcanvas, popovers, & tooltips #38560
-
I've been reading recently that most (if not all) commonly used browsers now support use of the native html dialog element, which is used for custom modal and popover like creation without bootstrap. My question is are there any plans for bootstrap to use this element at some point to create any of the following components: modals, offcanvases, popovers, & tooltips? some benefits to using this are that accessibility is mostly built in and interpreted by the browser, backdrop is included natively (can be styled with CSS), and escape keys automatically close a modal instances just to name a few. I've been reading over this dev's blog and he seems to have a solid understanding of the element works and goes into more detail. Modals Will Never Be The Same - HTML dialog Element below is a basic snippet HTML<dialog open>
<span>You can see me</span>
</dialog> JSconst dialog = document.querySelector("dialog");
dialog.show(); // Opens a non-modal dialog
dialog.showModal(); // Opens a modal |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yep, it's tracked in #33804 for modals first. Hopefully in v6 depending on other prioritized features and the upgrade of our |
Beta Was this translation helpful? Give feedback.
Yep, it's tracked in #33804 for modals first. Hopefully in v6 depending on other prioritized features and the upgrade of our
.browserslistrc
(and so the browsers' support).