Bootstrap 6 renders dialogs and drawers as native <dialog>
elements. That means the browser puts them in the top layer, so they sit above
every stacking context on the page without a z-index arms race.
It also means focus is trapped for you, Escape closes by default, and the
rest of the page is inert while the dialog is open — three things that took a
surprising amount of JavaScript in v5.
The trade is that the markup must actually be a <dialog>.
A div with class="dialog" will style correctly and then never
open, which is the single most common mistake when porting from v5.
Drawers are the same element with a different class. There is no separate
offcanvas component any more, and no separate JavaScript for it either.
Bootstrap 6 renders dialogs and drawers as native <dialog>
elements. That means the browser puts them in the top layer, so they sit above
every stacking context on the page without a z-index arms race.
It also means focus is trapped for you, Escape closes by default, and the
rest of the page is inert while the dialog is open — three things that took a
surprising amount of JavaScript in v5.
The trade is that the markup must actually be a <dialog>.
A div with class="dialog" will style correctly and then never
open, which is the single most common mistake when porting from v5.
Drawers are the same element with a different class. There is no separate
offcanvas component any more, and no separate JavaScript for it either.