How to Use Off-Canvas Dialog in Drupal 8
A slick new feature was recently added to Drupal 8 starting with the 8.5 release — out of the box off-canvas dialog support.
Off-canvas dialogs are those which slide out from off page. They push over existing content in order to make space for themselves while keeping the existing content unobstructed, unlike a traditional dialog popup. These dialogs are often used for menus on smaller screens. Most Drupal 8 users are familiar with Admin Toolbar's use of an off-canvas style menu tray, which is automatically enabled on smaller screens.
Drupal founder Dries posted a tutorial and I finally got a chance to try it myself.
In my case, I was creating a form for reviewers to submit reviews of long and complicated application submissions. Reviewers needed to be able to easily access the entire application while entering their review. A form at the bottom of the screen would have meant too much scrolling, and a traditional popup would have blocked much of the content they needed to see. Therefore, an off-canvas style dialog was the perfect solution.
Build your own
With the latest updates to Drupal core, you can now easily add your own off-canvas dialogs.