1 | # td-breadcrumbs
|
2 |
|
3 | `td-breadcrumbs` element generates breadcrumbs for navigation. Handles Responsive by removing breadcrumbs from the beginning of the list as allowable space decreases.
|
4 |
|
5 | ## API Summary
|
6 |
|
7 | #### Inputs
|
8 |
|
9 | - separatorIcon?: string
|
10 | - Sets the icon url shown between breadcrumbs. Defaults to 'chevron_right'.
|
11 |
|
12 | #### Methods
|
13 |
|
14 | - count: number
|
15 | - The total count of individual breadcrumbs (read only)
|
16 |
|
17 | #### Attributes
|
18 |
|
19 | - hiddenBreadcrumbs: TdBreadcrumbComponent[]
|
20 | - Array of currently hidden breadcrumbs (responsive)
|
21 |
|
22 | # td-breadcrumb
|
23 |
|
24 | `td-breadcrumb` element generates an individual breadcrumb component.
|
25 |
|
26 | ## API Summary
|
27 |
|
28 | #### Methods
|
29 |
|
30 | - displayCrumb: boolean
|
31 | - Whether to display the individual breadcrumb or not
|
32 | - width: number
|
33 | - The current width of the individual breadcrumb (read only)
|
34 |
|
35 | ## Setup
|
36 |
|
37 | Import the [CovalentBreadcrumbsModule] in your NgModule:
|
38 |
|
39 | ```typescript
|
40 | import { CovalentBreadcrumbsModule } from '@covalent/core/breadcrumbs';
|
41 | @NgModule({
|
42 | imports: [
|
43 | CovalentBreadcrumbsModule,
|
44 | ...
|
45 | ],
|
46 | ...
|
47 | })
|
48 | export class MyModule {}
|
49 | ```
|
50 |
|
51 | ## Usage
|
52 |
|
53 | Basic Example:
|
54 |
|
55 | ```html
|
56 | <td-breadcrumbs>
|
57 | <a td-breadcrumb [routerLink]="'/'">Home</a>
|
58 | <a td-breadcrumb [routerLink]="'/layouts'">Layouts</a>
|
59 | <a td-breadcrumb [routerLink]="'/layouts2'">Layouts2</a>
|
60 | <a td-breadcrumb [routerLink]="'/layouts3'">Layouts3</a>
|
61 | <td-breadcrumb>Manage List</td-breadcrumb>
|
62 | </td-breadcrumbs>
|
63 | ```
|
64 |
|
65 | Example with all inputs/outputs:
|
66 |
|
67 | ```html
|
68 | <td-breadcrumbs #breadcrumbs separatorIcon="motorcycle">
|
69 | <a td-breadcrumb [routerLink]="'/'">Home</a>
|
70 | <a td-breadcrumb [routerLink]="'/layouts'">Layouts</a>
|
71 | <a td-breadcrumb [routerLink]="'/layouts2'">Layouts2</a>
|
72 | <a td-breadcrumb [routerLink]="'/layouts3'">Layouts3</a>
|
73 | <td-breadcrumb>Manage List</td-breadcrumb>
|
74 | </td-breadcrumbs>
|
75 | <mat-divider></mat-divider>
|
76 | <div>Total Breadcrumbs Count: {{breadcrumbs.count}}</div>
|
77 | <div>
|
78 | Hidden Breadcrumbs Count (shrink window to see):
|
79 | {{breadcrumbs.hiddenBreadcrumbs.length}}
|
80 | </div>
|
81 | <ng-template
|
82 | let-breadcrumb
|
83 | let-index="index"
|
84 | ngFor
|
85 | [ngForOf]="breadcrumbs.hiddenBreadcrumbs"
|
86 | >
|
87 | <div>
|
88 | <p>Breadcrumb Number: {{index}}</p>
|
89 | <p>Breadcrumb Width: {{breadcrumb?.width}}</p>
|
90 | <mat-divider></mat-divider>
|
91 | </div>
|
92 | </ng-template>
|
93 | ```
|