|
4 | 4 |
|
5 | 5 | ### Expansion-panel content
|
6 | 6 |
|
7 |
| -Each expansion-panel must include a header and may optionally include an action bar. |
8 |
| - |
9 | 7 | #### Header
|
10 | 8 |
|
11 | 9 | The `<mat-expansion-panel-header>` shows a summary of the panel content and acts
|
12 | 10 | as the control for expanding and collapsing. This header may optionally contain an
|
13 | 11 | `<mat-panel-title>` and an `<mat-panel-description>`, which format the content of the
|
14 | 12 | header to align with Material Design specifications.
|
15 | 13 |
|
| 14 | +<!-- example({"example":"expansion-overview", |
| 15 | + "file":"expansion-overview-example.html", |
| 16 | + "region":"basic-panel"}) --> |
| 17 | + |
16 | 18 | By default, the expansion-panel header includes a toggle icon at the end of the
|
17 | 19 | header to indicate the expansion state. This icon can be hidden via the
|
18 |
| -`hideToggle` property. |
| 20 | +`hideToggle` property. |
19 | 21 |
|
20 |
| -```html |
21 |
| -<mat-expansion-panel> |
22 |
| - <mat-expansion-panel-header> |
23 |
| - <mat-panel-title> |
24 |
| - This is the expansion title |
25 |
| - </mat-panel-title> |
26 |
| - <mat-panel-description> |
27 |
| - This is a summary of the content |
28 |
| - </mat-panel-description> |
29 |
| - </mat-expansion-panel-header> |
30 |
| - |
31 |
| - <p>This is the primary content of the panel.</p> |
32 |
| - |
33 |
| -</mat-expansion-panel> |
34 |
| -``` |
| 22 | +<!-- example({"example":"expansion-overview", |
| 23 | + "file":"expansion-overview-example.html", |
| 24 | + "region":"hide-toggle"}) --> |
35 | 25 |
|
36 | 26 | #### Action bar
|
37 | 27 |
|
38 | 28 | Actions may optionally be included at the bottom of the panel, visible only when the expansion
|
39 | 29 | is in its expanded state.
|
40 | 30 |
|
41 |
| -```html |
42 |
| -<mat-expansion-panel> |
43 |
| - <mat-expansion-panel-header> |
44 |
| - This is the expansion title |
45 |
| - </mat-expansion-panel-header> |
46 |
| - |
47 |
| - <p>This is the primary content of the panel.</p> |
48 |
| - |
49 |
| - <mat-action-row> |
50 |
| - <button mat-button>Click me</button> |
51 |
| - </mat-action-row> |
52 |
| -</mat-expansion-panel> |
53 |
| -``` |
54 |
| - |
| 31 | +<!-- example({"example":"expansion-steps", |
| 32 | + "file":"expansion-steps-example.html", |
| 33 | + "region":"action-bar"}) --> |
55 | 34 | #### Disabling a panel
|
56 | 35 |
|
57 | 36 | Expansion panels can be disabled using the `disabled` attribute. A disabled expansion panel can't
|
58 | 37 | be toggled by the user, but can still be manipulated programmatically.
|
59 | 38 |
|
60 |
| -```html |
61 |
| -<mat-expansion-panel [disabled]="isDisabled"> |
62 |
| - <mat-expansion-panel-header> |
63 |
| - This is the expansion title |
64 |
| - </mat-expansion-panel-header> |
65 |
| - <mat-panel-description> |
66 |
| - This is a summary of the content |
67 |
| - </mat-panel-description> |
68 |
| -</mat-expansion-panel> |
69 |
| -``` |
70 |
| - |
| 39 | +<!-- example({"example":"expansion-expand-collapse-all", |
| 40 | + "file":"expansion-expand-collapse-all-example.html", |
| 41 | + "region":"disabled"}) --> |
71 | 42 |
|
72 | 43 | ### Accordion
|
73 | 44 |
|
74 | 45 | Multiple expansion-panels can be combined into an accordion. The `multi="true"` input allows the
|
75 | 46 | expansions state to be set independently of each other. When `multi="false"` (default) just one
|
76 | 47 | panel can be expanded at a given time:
|
77 | 48 |
|
78 |
| -```html |
79 |
| -<mat-accordion> |
80 |
| - |
81 |
| - <mat-expansion-panel> |
82 |
| - <mat-expansion-panel-header> |
83 |
| - This is the expansion 1 title |
84 |
| - </mat-expansion-panel-header> |
85 |
| - |
86 |
| - This the expansion 1 content |
87 |
| - |
88 |
| - </mat-expansion-panel> |
89 |
| - |
90 |
| - <mat-expansion-panel> |
91 |
| - <mat-expansion-panel-header> |
92 |
| - This is the expansion 2 title |
93 |
| - </mat-expansion-panel-header> |
94 |
| - |
95 |
| - This the expansion 2 content |
96 |
| - |
97 |
| - </mat-expansion-panel> |
98 |
| - |
99 |
| -</mat-accordion> |
100 |
| -``` |
| 49 | +<!-- example({"example":"expansion-expand-collapse-all", |
| 50 | + "file":"expansion-expand-collapse-all-example.html", |
| 51 | + "region":"multi"}) --> |
101 | 52 |
|
102 | 53 | ### Lazy rendering
|
103 | 54 | By default, the expansion panel content will be initialized even when the panel is closed.
|
|
0 commit comments