<td-layout-nav-list>
is a layout component which lets you customize a navigation
list view with toolbar items, item selections and footers.
To toggle/close/open the nav list sidenav from child layouts/components, you can use the [tdLayoutNavListToggle]
, [tdLayoutNavListClose]
or [tdLayoutNavListOpen]
directives on any element and its click event will trigger the sidenav action.
Example:
<button mat-icon-button [tdLayoutNavListToggle]="true" [hideWhenOpened]="true"> // or tdLayoutNavListOpen / tdLayoutNavListClose <mat-icon>menu</mat-icon> </button>
To disable the sidenav action, just set the input to false.
<button mat-icon-button [tdLayoutNavListToggle]="false"> <mat-icon>menu</mat-icon> </button>
[td-menu-button]
is used to include a menu button before the logo and title.
[td-sidenav-content]
is used to include items in the left side list.
[td-sidenav-toolbar-content]
is used to include items in the left toolbar.
[td-toolbar-content]
is used to include items in the right toolbar.
td-layout-footer-inner
is used to include items in the inner footer.
td-layout-footer
is used to include items in the main footer.
[tdLayoutNavListToggle]
is used to add the sidenav toggle behavior to any clickable element.
[tdLayoutNavListClose]
is used to add the sidenav close behavior to any clickable element.
[tdLayoutNavListOpen]
is used to add the sidenav open behavior to any clickable element.
Example for Nav List Layout:
<td-layout-nav-list sidenavTitle="title" logo="logo" icon="icon" opened="true" mode="side" sidenavWidth="350px" color="primary" navigationRoute="/"> <button mat-icon-button td-menu-button> // can use `[tdLayoutToggle]` to toggle main sidenav <mat-icon>menu</mat-icon> </button> <div td-sidenav-toolbar-content> ... left toolbar content </div> <mat-nav-list td-sidenav-content> <button mat-icon-button tdLayoutNavListOpen [hideWhenOpened]="true"> <mat-icon>arrow_back</mat-icon> </button> ... sidenav content </mat-nav-list> <div td-toolbar-content> ... right toolbar content </div> ... main content <td-layout-footer-inner> ... sub footer content </td-layout-footer-inner> <td-layout-footer color="primary"> // color is optional ... main footer content </td-layout-footer> </td-layout-nav-list>