Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material Design - Fixed Side Bar

How do i create a fixed side bar and a scrollable content. Like shown on their website.

https://material.angular.io/components/

I tried using this - https://material.angular.io/components/sidenav/examples

But it forces you to set the width and the height which i dont want to do as i want to use the full browser width and it be responsive.

.example-sidenav-fab-container {
  width: 500px;
  height: 300px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}
like image 938
Kay Avatar asked Nov 19 '25 11:11

Kay


1 Answers

Position fixed does not work on the side nav as expected so you must set the width and height to fixed amount for the side nav to be fixed with a scrollable content.

Issue is documented and meant to be fixed in next release. https://github.com/angular/material2/issues/998

Temporary fix:

.mat-sidenav-content,
.mat-sidenav-container,
.mat-drawer-content {
    transform: none !important;
}

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!