← All dialogs Scrollable dialog 2 of 10
‹ ›

Scrollable dialog

Long content, fixed actions. Compare with the basic dialog, where the whole box grows.

Without .dialog-scrollable the dialog grows and the page behind it scrolls instead — which on a phone usually means the confirm button is somewhere below the fold.

Terms of service

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.

Terms of service

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.