diff --git a/src/lib/sidenav/sidenav.md b/src/lib/sidenav/sidenav.md index b367fac0bd85..c8aed710e66e 100644 --- a/src/lib/sidenav/sidenav.md +++ b/src/lib/sidenav/sidenav.md @@ -117,7 +117,15 @@ If no `mode` is specified, `over` is used by default. -`` also supports all of these same modes. +The `over` and `push` sidenav modes show a backdrop by default, while the `side` mode does not. This +can be customized by setting the `hasBackdrop` property on `mat-sidenav-container`. Explicitly +setting `hasBackdrop` to `true` or `false` will override the default backdrop visibility setting for +all sidenavs regadless of mode. Leaving the property unset or setting it to `null` will use the +default backdrop visibility for each mode. + + + +`` also supports all of these same modes and options. ### Disabling automatic close diff --git a/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.css b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.css new file mode 100644 index 000000000000..d0bcca980f2f --- /dev/null +++ b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.css @@ -0,0 +1,6 @@ +.example-container { + width: 400px; + height: 200px; + margin: 10px; + border: 1px solid #555; +} diff --git a/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.html b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.html new file mode 100644 index 000000000000..0fa69dee3b94 --- /dev/null +++ b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.html @@ -0,0 +1,22 @@ + + I'm a drawer + + + Sidenav mode + + Side + Over + Push + + + + Has backdrop + + Unset + True + False + + + + + diff --git a/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.ts b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.ts new file mode 100644 index 000000000000..c945bb03b0f3 --- /dev/null +++ b/src/material-examples/sidenav-backdrop/sidenav-backdrop-example.ts @@ -0,0 +1,9 @@ +import {Component} from '@angular/core'; + +/** @title Drawer with explicit backdrop setting */ +@Component({ + selector: 'sidenav-backdrop-example', + templateUrl: 'sidenav-backdrop-example.html', + styleUrls: ['sidenav-backdrop-example.css'], +}) +export class SidenavBackdropExample {}