Offcanvas
A sliding panel component that appears from the edges of the screen, providing additional content or functionality without disrupting the main interface.Basic Offcanvas
Create a standard offcanvas panel with a trigger button, header, and body content.
Basic Offcanvas
Offcanvas Options
The Offcanvas component supports various configuration options.Offcanvas::PLACEMENT_LEFT
- Positions the panel at the left side (start) of the screenOffcanvas::PLACEMENT_RIGHT
- Positions the panel at the right side (end) of the screenOffcanvas::PLACEMENT_TOP
- Positions the panel at the top of the screenOffcanvas::PLACEMENT_BOTTOM
- Positions the panel at the bottom of the screenOffcanvas::BACKDROP_DISABLED
- Disables the backdrop overlayOffcanvas::ESC_EXIT_DISABLED
- Disables closing the panel with ESC keyOffcanvas::SCROLL_DISABLED
- Disables scrolling of the main content when panel is open
Offcanvas Examples
Here are examples of different offcanvas options and styles.Left Placement Offcanvas
Create a panel that slides in from the left side of the screen by using the PLACEMENT_LEFT
option.
Left Offcanvas
Right Placement Offcanvas
Create a panel that slides in from the right side of the screen by using the PLACEMENT_RIGHT
option.
Right Offcanvas
Top Placement Offcanvas
Create a panel that slides down from the top of the screen by using the PLACEMENT_TOP
option.
Top Offcanvas
Bottom Placement Offcanvas
Create a panel that slides up from the bottom of the screen by using the PLACEMENT_BOTTOM
option.
Bottom Offcanvas
Offcanvas Without Backdrop
Create a panel with the backdrop overlay disabled by using the BACKDROP_DISABLED
option.
No Backdrop Offcanvas
Offcanvas with HTML Content
Create a panel with rich HTML content in the body.
HTML Content Offcanvas
Offcanvas Content
This is a paragraph in the panel body.
Combined Options Offcanvas
Combine multiple options to create a highly customized offcanvas panel using bitwise operators.
Combined Options Offcanvas
Combined Options Offcanvas
This panel combines multiple options.
API
The Offcanvas component provides methods for creating and configuring offcanvas panels.API PHP
API JS
Events
You can listen to events on the GridJS component using the bouion()
method.Common alternative names: Sidebar, Drawer, Slide Panel, Edge Panel, Sliding Panel, Side Panel, Off-screen Menu
Types: Left/Start Panels, Right/End Panels, Top Panels, Bottom Panels, No-Backdrop Panels, HTML Content Panels, Custom Option Panels
Principles
Progressive Disclosure
Offcanvas panels reveal additional content or options progressively, keeping the main interface clean and focused until needed.
Spatial Efficiency
By sliding in from the edges, offcanvas panels make efficient use of screen space without permanently taking up valuable real estate.
Contextual Presence
Offcanvas panels maintain context with the main interface while providing additional functionality or content.
Anatomy

- Trigger Element
- Backdrop
- Panel
- Header
- Body
- Close Button
The element that opens the offcanvas panel
The overlay that dims the background
The container that slides in from an edge
The top section with title and close button
The main content area of the panel
The element to dismiss the panel
Usage
Use offcanvas panels to provide additional content or functionality without disrupting the main interface. They're particularly effective for navigation menus, filters/sorting options, configuration panels, secondary content, detail views, and forms that don't need to block the main interface.