0
0
Bootsrapmarkup~5 mins

Offcanvas component in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an Offcanvas component in Bootstrap?
An Offcanvas component is a sidebar panel that slides in from the side of the screen. It is used to show hidden content like menus or information without leaving the current page.
Click to reveal answer
beginner
How do you trigger an Offcanvas component to open in Bootstrap?
You use a button or link with data-bs-toggle="offcanvas" and data-bs-target="#offcanvasExample" attributes to open the Offcanvas panel with the matching ID.
Click to reveal answer
beginner
Which Bootstrap class defines the Offcanvas panel container?
The class <code>offcanvas</code> defines the Offcanvas panel container. You also add a position class like <code>offcanvas-start</code> or <code>offcanvas-end</code> to set the slide direction.
Click to reveal answer
intermediate
How can you make the Offcanvas component accessible for keyboard users?
Bootstrap Offcanvas automatically traps keyboard focus inside the panel when open and allows closing with the Escape key. Use semantic HTML and ARIA roles for better accessibility.
Click to reveal answer
beginner
What is the purpose of the offcanvas-header and offcanvas-body classes?
offcanvas-header styles the top area of the Offcanvas panel, usually containing the title and close button. offcanvas-body holds the main content inside the panel.
Click to reveal answer
Which attribute is used to toggle an Offcanvas component in Bootstrap?
Adata-toggle="modal"
Bdata-bs-target="#modal"
Cdata-bs-toggle="offcanvas"
Ddata-toggle="dropdown"
What class would you add to make the Offcanvas slide in from the right side?
Aoffcanvas-end
Boffcanvas-top
Coffcanvas-start
Doffcanvas-bottom
Which element usually contains the close button inside an Offcanvas?
Aoffcanvas-footer
Boffcanvas-header
Coffcanvas-body
Doffcanvas-close
How can users close an open Offcanvas component using the keyboard?
APress the Escape key
BPress the Tab key
CPress the Spacebar
DPress the Enter key
What is the main purpose of the Offcanvas component?
ATo create modal popups
BTo display dropdown menus
CTo replace the navbar
DTo show hidden side content without leaving the page
Explain how to create a basic Offcanvas component in Bootstrap and how to open it with a button.
Think about the HTML structure and attributes needed.
You got /4 concepts.
    Describe accessibility features Bootstrap Offcanvas provides and why they are important.
    Consider how users with disabilities interact with UI.
    You got /4 concepts.