Fullscreen the Material Sidenav Container

Ole Ersoy
Ole Ersoy
Nov 7 · 1 min read
Image by cocoparisienne from Pixabay

Scenario

We want our mat-sidenav-container to cover the entire screen.

Approach

Use the fullscreen directive.

<mat-sidenav-container fullscreen>

Demo

Try removing fullscreen and see what happens:

Bonus

Complete markup that can be used inside a custom component replacing mat-sidenav-container:

<mat-sidenav-container fullscreen>
<ng-content></ng-content>
</mat-sidenav-container>
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade