Offcanvas
Build hidden sidebars into your project for navigation, shopping carts, and more.
Examples
Offcanvas includes support for a header with a close button and an optional body class for some initial padding. We suggest that you include offcanvas headers with dismiss actions whenever possible, or provide an explicit dismiss action.
Basic Example
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 supports a few different placements:
start
places offcanvas on the left of the viewportend
places offcanvas on the right of the viewporttop
places offcanvas on the top of the viewportbottom
places offcanvas on the bottom of the viewport
Backdrop
Scrolling the <body>
element is disabled when an offcanvas and its backdrop are
visible. Use the scroll
prop to toggle <body>
scrolling and the backdrop
prop
to toggle the backdrop.
Static backdrop
When backdrop
is set to static
, the offcanvas will not close when clicking outside of it.