You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/stepper/stepper.md
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,7 @@ by placing a `matStepperIcon` for each of the icons that you want to override. T
157
157
Note that you aren't limited to using the `mat-icon` component when providing custom icons.
158
158
159
159
#### Step States
160
-
You can set the state of a step to whatever you want. The given state by default maps to an icon. However, it can be overridden the same way as metioned above.
160
+
You can set the state of a step to whatever you want. The given state by default maps to an icon. However, it can be overridden the same way as mentioned above.
161
161
162
162
```html
163
163
<mat-horizontal-stepper>
@@ -188,6 +188,35 @@ You can set the state of a step to whatever you want. The given state by default
188
188
</mat-horizontal-stepper>
189
189
```
190
190
191
+
In order to use the custom step states, you must add the `useGuidelines` option to the global default stepper options which can be specified by providing a value for
192
+
`MAT_STEPPER_GLOBAL_OPTIONS` in your application's root module.
193
+
194
+
```ts
195
+
@NgModule({
196
+
providers: [
197
+
{
198
+
provide: MAT_STEPPER_GLOBAL_OPTIONS,
199
+
useValue: { useGuidelines: true }
200
+
}
201
+
]
202
+
})
203
+
```
204
+
205
+
### Error State
206
+
207
+
The stepper can now show error states by simply providing the `showError` option to the `MAT_STEPPER_GLOBAL_OPTIONS` in your application's root module as mentioned above.
208
+
209
+
```ts
210
+
@NgModule({
211
+
providers: [
212
+
{
213
+
provide: MAT_STEPPER_GLOBAL_OPTIONS,
214
+
useValue: { showError: true }
215
+
}
216
+
]
217
+
})
218
+
```
219
+
191
220
### Keyboard interaction
192
221
- <kbd>LEFT_ARROW</kbd>: Focuses the previous step header
193
222
- <kbd>RIGHT_ARROW</kbd>: Focuses the next step header
0 commit comments