Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components-examples/material/toolbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export {ToolbarMultirowExample} from './toolbar-multirow/toolbar-multirow-exampl
export {ToolbarSimpleExample} from './toolbar-simple/toolbar-simple-example';
export {ToolbarOverviewExample} from './toolbar-overview/toolbar-overview-example';
export {ToolbarHarnessExample} from './toolbar-harness/toolbar-harness-example';
export {ToolbarNavbarExample} from './toolbar-navbar/toolbar-navbar-example';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.example-spacer {
flex: 1 1 auto;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<mat-toolbar>
<span>My App</span>

<span class="example-spacer"></span>

<a mat-button>Home</a>
<a mat-button>Products</a>
<a mat-button>Pricing</a>
<a mat-button>About</a>
</mat-toolbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Component} from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
import {MatToolbarModule} from '@angular/material/toolbar';

/**
* @title Toolbar as a navigation bar
*/
@Component({
selector: 'toolbar-navbar-example',
templateUrl: 'toolbar-navbar-example.html',
styleUrl: 'toolbar-navbar-example.css',
imports: [MatToolbarModule, MatButtonModule],
})
export class ToolbarNavbarExample {}
7 changes: 7 additions & 0 deletions src/material/toolbar/toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ easily accomplished with `display: flex`:
"file":"toolbar-multirow-example.css",
"region":"toolbar-position-content-style"}) -->

### Navigation bar

A common use case for a toolbar is as a navigation bar containing links to
different sections of an application.

<!-- example(toolbar-navbar) -->

### Accessibility
By default, the toolbar assumes that it will be used in a purely decorative fashion and thus sets
no roles, ARIA attributes, or keyboard shortcuts. This is equivalent to having a sequence of `<div>`
Expand Down
Loading