<td-layout>
is a blank main sidenav component that gets hooked as parent of all the other layouts. (triggered by their menu buttons)
[td-sidenav-content]
is used to include content in the main sidenav.
Example for Main Layout:
<td-layout [mode]="'side'" [opened]="true" [sidenavWidth]="'257px'"> <div td-sidenav-content> .. more sidenav content </div> .. main content </td-layout>
To toggle/close/open the main sidenav from child layouts/components, you can use the [tdLayoutToggle]
, [tdLayoutClose]
or [tdLayoutOpen]
directives on any element and its click event will trigger the sidenav action.
Example:
<button mat-icon-button [tdLayoutToggle]="true"> // or tdLayoutOpen / tdLayoutClose <mat-icon>menu</mat-icon> </button>
To disable the sidenav action, just set the input to false.
<button mat-icon-button [tdLayoutToggle]="false"> <mat-icon>menu</mat-icon> </button>
This component can be installed as npm package.
npm i -save @covalent/core
Import the [CovalentLayoutModule] in your NgModule:
import { CovalentLayoutModule } from '@covalent/core/layout'; @NgModule({ imports: [ CovalentLayoutModule, ... ], ... }) export class MyModule {}
See theming in the covalent docs for more info.
<td-navigation-drawer>
is a component that follows the material design spec is used as an addon component for td-layout
.
[td-sidenav-content]
is used to include content in the main sidenav.
[td-navigation-drawer-menu]
is used to include content to the toggle
user menu. if no tag is used, then the toggle button dissapears.
Example for Main Layout / Navigation Drawer Combo:
<td-layout> <td-navigation-drawer sidenavTitle="title" logo="logo" icon="icon" name="name" password="password" color="color" navigationRoute="/"> .. main drawer content <div td-navigation-drawer-menu> .. menu drawer content </div> </td-navigation-drawer> <div td-sidenav-content> .. more sidenav content </div> .. main content </td-layout>