Offcanvas
Basic example
Offcanvas is a sidebar component that can be toggled via JavaScript. The example below shows a simple offcanvas navigation.
Body scrolling
Scrolling the <body>
element is disabled when an offcanvas and its backdrop are visible. Use the data-bs-scroll
attribute to enable <body>
scrolling.
Static backdrop
When backdrop is set to static, the offcanvas will not close when clicking outside of it.
Responsive
Responsive offcanvas classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual.
Placement
Offcanvas can be placed on left, right, top or bottom of your screen.