Skip to the dialogs
Bootstrap 6.0.0-alpha1

Bootstrap 6 Dialogs & Drawers

v6 rebuilt this area completely: Modal became Dialog, Offcanvas became Drawer, and both are now native <dialog> elements. Ten variants covering sizes, scrolling, forms, destructive confirms, non-modal panels, four-sided drawers, bottom sheets, toasts and motion.

Porting from v5

The renames are the easy part: Modal is Dialog, Offcanvas is Drawer, and the data attributes follow — data-bs-toggle="dialog", data-bs-dismiss="drawer". There is no window.bootstrap global any more either; v6 is ESM-only, so the script tag needs type="module".

The mistake everyone makes

Both components must be actual <dialog> elements. A <div class="dialog"> or <div class="drawer"> will style correctly, look finished, and never open. Nothing is logged. If a drawer div also sits inside a navbar-expand ancestor, its contents render inline on desktop, which usually shows up as a navigation menu appearing twice.

What you get for free

The top layer, so no z-index conflicts with sticky headers. Focus trapping while open and focus restored to the trigger on close. Escape to dismiss. Content behind marked inert. All of that was hand-rolled JavaScript in v5.

What is genuinely new

.dialog-nonmodal has no v5 equivalent — a dialog with no backdrop that leaves the page interactive underneath, for inspectors and help panels. .drawer-sheet with .drawer-fit-content gives you the mobile bottom-sheet pattern without writing any of it. And .dialog-instant lets you skip the entry animation where it would read as lag.