Layout · Gutenberg

Off-Canvas Drawer block for WordPress

Slide-out side panel (drawer) triggered by a button.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Slide-out side panel (drawer) triggered by a button.

Inspector panels on this block: Trigger Button, Drawer Content, Behavior. Those titles come from index.js, not from a shared template.

Behavior controls: “Trigger Button — Icon” options: Menu (hamburger), Arrow right, Plus, Settings, Info; “Position” options: Right, Left.

Where to find it

Gutenberg inserter → Layout → search “Off-Canvas Drawer” (block name `blockenberg/off-canvas` in block.json). Style it in the sidebar after insert.

How to use Off-Canvas Drawer block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Off-Canvas Drawer”, insert it. Category: Layout.
  3. Configure inspector controls that exist on this block. Open Trigger Button. Set “Button Label”, “Show Icon”, “Trigger Button — Icon”, “Button Radius (px)”.
  4. Check the published page. The view script reads HTML data attributes: data-close-escape, data-close-overlay, data-overlay, data-position. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Button LabelText field in the inspector. block.json default: Open Menu. Saved as `triggerLabel`.
Show IconOn/off toggle in the inspector. On by default. Saved as `showIcon`.
Trigger Button — IconSelect control; the chosen value is saved on the block. Options: Menu (hamburger); Arrow right; Plus; Settings; Info; Cart; List; Share. block.json default: menu. Saved as `triggerIcon`.
Button Radius (px)Numeric range control in the inspector. Range 0–50. block.json default: 8. Saved as `triggerRadius`.
Button Padding (px)Numeric range control in the inspector. Range 4–30. block.json default: 12. Saved as `triggerPadding`.
PositionSelect control; the chosen value is saved on the block. Options: Right; Left. block.json default: right. Saved as `position`.
Drawer Width (px)Numeric range control in the inspector. Range 200–700. block.json default: 320. Saved as `width`.
Show Drawer TitleOn/off toggle in the inspector. On by default. Saved as `showDrawerTitle`.
Drawer TitleText field in the inspector. block.json default: Drawer Title. Saved as `drawerTitle`.
Drawer Content (HTML supported)Multiline text field in the inspector. block.json default: Your content goes here. Add links, text, images or any HTML.. Saved as `content`.
OverlayOn/off toggle in the inspector. On by default. Saved as `overlayEnabled`.
Close on Overlay ClickOn/off toggle in the inspector. On by default. Saved as `closeOnOverlay`.
Close on Escape KeyOn/off toggle in the inspector. On by default. Saved as `closeOnEscape`.
Animation Speed (ms)Numeric range control in the inspector. Range 100–800. block.json default: 300. Saved as `animationSpeed`.
Overlay Opacity %Numeric range control in the inspector. Range 10–90. block.json default: 40. Saved as `overlayOpacity`.
Button BackgroundColor control in the inspector. block.json default: #6c3fb5. Saved as `triggerBg`.
Button TextColor control in the inspector. block.json default: #ffffff. Saved as `triggerColor`.
Drawer BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `drawerBg`.
Drawer BorderColor control in the inspector. block.json default: #e5e7eb. Saved as `drawerBorder`.
Title ColorColor control in the inspector. block.json default: #1f2937. Saved as `titleColor`.
Content ColorColor control in the inspector. block.json default: #374151. Saved as `contentColor`.
Close IconColor control in the inspector. block.json default: #6b7280. Saved as `closeIconColor`.
Overlay ColorColor control in the inspector. block.json default: #000000. Saved as `overlayColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Off-Canvas Drawer block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Off-Canvas Drawer”. It sits under Layout. After insert, open Trigger Button and set “Button Label”, “Show Icon”, “Trigger Button — Icon”, “Button Radius (px)”.

What makes Off-Canvas Drawer different from other Blockenberg blocks?

Slide-out side panel (drawer) triggered by a button. Inspector labels on this block include “Button Label”, “Show Icon”, “Trigger Button — Icon”, “Button Radius (px)”.

Is the Off-Canvas Drawer Gutenberg block free?

Yes. Off-Canvas Drawer ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Off-Canvas Drawer to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Trigger Button, Drawer Content, Behavior).

Related layout blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Off-Canvas Drawer from the Gutenberg inserter.

Get Blockenberg