11< div class ="demo-chips ">
22 < mat-card >
3- < mat-toolbar color =" primary " > Static Chips</ mat-toolbar >
3+ < mat-card-header > Static Chips</ mat-card-header >
44
55 < mat-card-content >
66 < h4 > Simple</ h4 >
@@ -111,26 +111,24 @@ <h4>With Events</h4>
111111 </ mat-card >
112112
113113 < mat-card >
114- < mat-toolbar color =" primary " > Selectable Chips </ mat-toolbar >
114+ < mat-card-header > Chip Listbox </ mat-card-header >
115115
116116 < mat-card-content >
117- < button matButton (click) ="disabledListboxes = !disabledListboxes ">
118- {{disabledListboxes ? "Enable" : "Disable"}}
119- </ button >
120- < button matButton (click) ="listboxesWithAvatar = !listboxesWithAvatar ">
121- {{listboxesWithAvatar ? "Hide Avatar" : "Show Avatar"}}
122- </ button >
117+ < p > Chip list utilizing the listbox pattern. Should be used for selectable chips.</ p >
118+
119+ < mat-checkbox [(ngModel)] ="disabledListboxes "> Disabled</ mat-checkbox >
120+ < mat-checkbox [(ngModel)] ="listboxesWithAvatar "> Show avatar</ mat-checkbox >
123121
124122 < h4 > Single selection</ h4 >
125123
126124 < mat-chip-listbox multiple ="false " [disabled] ="disabledListboxes ">
127125 @for (shirtSize of shirtSizes; track shirtSize) {
128- < mat-chip-option [disabled] ="shirtSize.disabled ">
129- {{shirtSize.label}}
130- @if (listboxesWithAvatar) {
131- < mat-chip-avatar > {{shirtSize.avatar}}</ mat-chip-avatar >
132- }
133- </ mat-chip-option >
126+ < mat-chip-option [disabled] ="shirtSize.disabled ">
127+ {{shirtSize.label}}
128+ @if (listboxesWithAvatar) {
129+ < mat-chip-avatar > {{shirtSize.avatar}}</ mat-chip-avatar >
130+ }
131+ </ mat-chip-option >
134132 }
135133 </ mat-chip-listbox >
136134
@@ -151,7 +149,7 @@ <h4>Multi selection</h4>
151149 </ mat-card >
152150
153151 < mat-card >
154- < mat-toolbar color =" primary " > Input Chips </ mat-toolbar >
152+ < mat-card-header > Chip Grid </ mat-card-header >
155153
156154 < mat-card-content >
157155 < p >
@@ -160,13 +158,9 @@ <h4>Multi selection</h4>
160158 They can be used inside a < code > <mat-form-field></ code > .
161159 </ p >
162160
163- < button matButton (click) ="disableInputs = !disableInputs ">
164- {{disableInputs ? "Enable" : "Disable"}}
165- </ button >
166-
167- < button matButton (click) ="editable = !editable ">
168- {{editable ? "Disable editing" : "Enable editing"}}
169- </ button >
161+ < mat-checkbox [(ngModel)] ="disableInputs "> Disabled</ mat-checkbox >
162+ < mat-checkbox [(ngModel)] ="editable "> Editable</ mat-checkbox >
163+ < mat-checkbox [(ngModel)] ="disabledInteractive "> Disabled Interactive</ mat-checkbox >
170164
171165 < h4 > Input is last child of chip grid</ h4 >
172166
@@ -188,19 +182,15 @@ <h4>Input is last child of chip grid</h4>
188182 [matChipInputFor] ="chipGrid1 "
189183 [matChipInputSeparatorKeyCodes] ="separatorKeysCodes "
190184 [matChipInputAddOnBlur] ="addOnBlur "
185+ [matChipInputDisabledInteractive] ="disabledInteractive "
191186 (matChipInputTokenEnd) ="add($event) "
192- aria-label =" New contributor input... " />
187+ placeholder =" Add a contributor " />
193188 </ mat-chip-grid >
194- < input [disabled] ="disableInputs "
195- [matChipInputFor] ="chipGrid1 "
196- [matChipInputSeparatorKeyCodes] ="separatorKeysCodes "
197- [matChipInputAddOnBlur] ="addOnBlur "
198- (matChipInputTokenEnd) ="add($event) " />
199189 </ mat-form-field >
200190
201191 < h4 > Input is next sibling child of chip grid</ h4 >
202192
203- < mat-form-field >
193+ < mat-form-field class =" demo-has-chip-list " >
204194 < mat-label > New Contributor...</ mat-label >
205195 < mat-chip-grid #chipGrid2 [(ngModel)] ="selectedPeople " required [disabled] ="disableInputs ">
206196 @for (person of people; track person) {
@@ -215,7 +205,9 @@ <h4>Input is next sibling child of chip grid</h4>
215205 < input [matChipInputFor] ="chipGrid2 "
216206 [matChipInputSeparatorKeyCodes] ="separatorKeysCodes "
217207 [matChipInputAddOnBlur] ="addOnBlur "
218- (matChipInputTokenEnd) ="add($event) "/>
208+ [matChipInputDisabledInteractive] ="disabledInteractive "
209+ (matChipInputTokenEnd) ="add($event) "
210+ placeholder ="Add a contributor "/>
219211 </ mat-form-field >
220212
221213 < p >
@@ -232,7 +224,7 @@ <h4>Options</h4>
232224 </ mat-card >
233225
234226 < mat-card >
235- < mat-toolbar color =" primary " > Miscellaneous</ mat-toolbar >
227+ < mat-card-header > Miscellaneous</ mat-card-header >
236228 < mat-card-content >
237229 < h4 > Stacked</ h4 >
238230
0 commit comments