Off-canvas panel
A button that slides in a panel from the side, for menus or more information.
Watch the video
Chapters and transcript Captions are included.
Use this element#
Use an off-canvas panel for content that opens from a side of the page. Edit the opener’s words, the panel’s content, its direction, dimensions, overlay, motion, and accessible name.
Test opening and closing with keyboard and touch input. The page-scroll setting affects the page behind the panel. For a reusable site-wide panel with targeting and triggers, use the separate Popups system.
Availability#
Available through the appropriate content or section picker when the theme and editing context allow it.
Content controls#
These are the controls registered for this element. A control that depends on another setting or the surrounding layout appears only when it applies.
Opens from#
| Choice | Stored value |
|---|---|
| The right | (empty/default) |
| The left | cb-left |
| The top | cb-top |
| The bottom | cb-bottom |
Width in pixels#
Input type: number. Enter the desired value, then check the page result.
Min: 200; Max: 1200; Step: 10.
This control is conditional on the element’s current state or layout. A hidden control does not indicate that its stored value has been deleted.
Height#
| Choice | Stored value |
|---|---|
| Fits its content | (empty/default) |
| The whole screen | cb-tall |
This control is conditional on the element’s current state or layout. A hidden control does not indicate that its stored value has been deleted.
Opening and closing#
| Choice | Stored value |
|---|---|
| Slide | (empty/default) |
| Fade | cb-fade |
| No animation | cb-still |
Behind the panel#
| Choice | Stored value |
|---|---|
| The page, dimmed | (empty/default) |
| The page, darkened | dark |
| The page, lightened | light |
| The page as it is | none |
A click outside the panel closes it#
Turn this option on or off. The label describes the behavior being enabled.
The page can scroll while it is open#
Turn this option on or off. The label describes the behavior being enabled.
Panel name for screen readers#
Input type: text. Enter the desired value, then check the page result.
Save and check#
- Change one setting and inspect the affected element.
- Use Undo and Redo to check the edit is reversible.
- Save a draft, reopen it, and confirm the content and choices remain.
- Inspect the page at desktop and phone widths.
- Publish only when the result is ready. For interactive elements, check the visitor view because editing mode can suppress interaction.
How it is stored#
The block comes from blocks/560-offcanvas.html. Its editable content is HTML in the page or owning template. Native settings update words, attributes, classes, or supported style properties. Generated interface controls are not saved into that HTML.
The settings registry matches .cb-offcanvas in assets/element-settings.js. Public behavior, when needed, is implemented by the native element runtime in assets/elements.js or assets/blocks.js.