Offcanvas

Live demo

Use the buttons below to show and hide an offcanvas element via JavaScript that toggles the .show class on an element with the .offcanvas class.

Link with href
Offcanvas
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.

Body scrolling

Scrolling the element is disabled when an offcanvas and its backdrop are visible. Use the data-bs-scroll attribute to enable scrolling.

Offcanvas with body scrolling

Try scrolling the rest of the page to see this option in action.

Body scrolling and backdrop

You can also enable scrolling with a visible backdrop.

Backdrop with scrolling

Try scrolling the rest of the page to see this option in action.

Static backdrop

When backdrop is set to static, the offcanvas will not close when clicking outside of it.

Offcanvas
I will not close if you click outside of me.