Offcanvas
The Offcanvas element is a nestable panel that slides (or offsets) in from a chosen edge of the viewport. Typical use: mobile navigation. Bricks suggests adding a Toggle elsewhere on the page that targets this Offcanvas (see the in-element info link to the menu builder article).
The default structure includes an inner Block (.brx-offcanvas-inner) for your content—often with starter Text and a Toggle labeled for closing—and a second Block acting as the Backdrop (.brx-offcanvas-backdrop), which you can remove if you do not want a backdrop.
Settings
Section titled “Settings”-
Direction (select) —
top,right,bottom, orleft. Default: left. -
Effect (select) —
slideoroffset. -
Close on (select) —
backdrop(click),esc,none, or default: backdrop and ESC. -
Width, Height (number with units) — Size of the inner panel (
.brx-offcanvas-inner). -
Transition: Duration (number with units) — Open/close animation; set to
0sto disable. -
Transition: Timing function (text) — Easing, e.g.
cubic-bezier(0.25, 0, 0.25, 1). -
aria-label (text) — Root dialog label; defaults to “Offcanvas”.
-
Keep open while styling (checkbox) — Builder helper class
brx-opento keep the panel open while designing. -
No scroll (body) (checkbox) — Prevents body scrolling while open.
-
Scroll to top (checkbox) — Scrolls to top when the Offcanvas opens.
-
Disable auto focus (checkbox) — Skips auto-focusing the first focusable element when opening.
-
Open on page load (checkbox) — Opens on the front end when the page loads (not applied in the builder).
Build a mobile menu
Section titled “Build a mobile menu”This example replaces the menu element’s built-in mobile menu with an Offcanvas, so the phone menu can have its own design and extra content such as contact details.
- Open the header template, select the header section, and add an Offcanvas. It is hidden on the canvas until you select it.
- Turn on Keep open while styling. Without it, the panel closes as soon as you select an element inside it.
- Set Direction, Width, and No scroll (body) to suit the design, for example
Rightand86%. - Replace the starter Basic Text with your menu, for example a Nav Menu element that uses the same WordPress menu as the desktop header. Set its Show at breakpoint to
Never, so it always shows the links instead of its own menu button. - Add a Toggle to the header. Select the Offcanvas, hover the b icon at the top of the panel, and click # (Copy: CSS ID). Paste the ID into the Toggle’s CSS selector.
- On the Toggle’s Style tab, set Display (Layout group) to
noneon desktop. Switch to the breakpoint where the menu should change, for example Tablet portrait, set the Toggle’s Display toflex, and set the desktop menu’s Display tonone. Smaller breakpoints inherit both settings. - Save. Keep open while styling is a Builder helper: it is not saved and does not affect the frontend.


Opening, closing, and keyboard focus
Section titled “Opening, closing, and keyboard focus”A Toggle opens the Offcanvas by adding the class brx-open to it. While the Offcanvas is open:
- Focus moves to the first focusable element inside it. Turn on Disable auto focus to skip this. If the close Toggle is the first element in Content, focus lands on it.
- Tab and Shift+Tab stay inside the panel: from the last focusable element, Tab wraps back to the first.
- With No scroll (body) on, the page behind the panel does not scroll.
- The Toggle that opened it has
aria-expanded="true".
The Offcanvas closes on a click on the backdrop, on Esc, or with a Toggle inside it. Close on limits this to the backdrop or Esc, or turns both off. When it closes, focus returns to the Toggle that opened it. While closed, the panel is hidden, so its links cannot be reached with Tab.
Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.