Bootstrap Offcanvas
- Bootstrap Offcanvas is a component that provides a flexible and dynamic way to display content outside the main content area of a website.
- It is perfect for mobile devices and small screens, where the main content may not be easily accessible.
Syntax
To use Bootstrap Offcanvas in your HTML file, you need to add the following code:
<button class="btn btn-primary" type="button" data-toggle="offcanvas" data-target="#offcanvasExample" aria-controls="offcanvasExample" aria-expanded="false">
Toggle offcanvas
</button>
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvasExample" aria-labelledby="offcanvasExampleLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasExampleLabel">Offcanvas</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
...
</div>
</div>