Skip to content

Creating Offcanvas Sidebar with Bootstrap 5

Original guide · All levels

Intro You can add hidden sidebars for your web sites and apps for navigation, shopping carts, and more which appear from the left, right, or bottom edge of the viewport. You can show and hide them usi

You can add hidden sidebars for your web sites and apps for navigation, shopping carts, and more which appear from the left, right, or bottom edge of the viewport. You can show and hide them using buttons, links or other elements on your page. You can also control the Offcanvas Sidebars using App Connect dynamic events.
This is possible thanks to the Offcanvas component in Bootstrap 5.

We created a simple Bootstrap 5 page, where we want to add the Offcanvas component.
Open the App Connect panel, select App and add a new component:

Open the Components menu and select Dynamic Offcanvas:

Section titled “Open the Components menu and select Dynamic Offcanvas:”

The Offcanvas component has been added on your page.

Section titled “The Offcanvas component has been added on your page.”

You can find its properties in the Properties panel:

You can select the position of the Offcanvas - Start, End or Bottom.
Start - The Offcanvas appears from the left edge of the viewport
End - The Offcanvas appears from the right edge of the viewport
Bottom - The Offcanvas appears from the bottom edge of the viewport

Customize the rest of the options as you need:

Section titled “Customize the rest of the options as you need:”

Scroll - Allow body scrolling while offcanvas is open
Auto Show - Show the officanvas when the page loads
No Backdrop - Disable the backdrop on page body while offcanvas is open
No Keyboard - Disable closing of the offcanvas when escape key is pressed

The offcanvas component contains a header and body.
You can add your content in the offcanvas body:

You can control the Offcanvas Component using any any element on your page.

The easiest way to control the offcanvas is using a button. Select your button and open the Action Toggle menu:

You can also use App Connect Dynamic Events to Open, Close or Toggle the offcanvas:

Select the event you want to use, in our case on click:

Section titled “Select the event you want to use, in our case on click:”

Select Show under the Offcanvas Component and add it:

Section titled “Select Show under the Offcanvas Component and add it:”