Skip to content

Commit 8ff6fc8

Browse files
committed
docs(stepper): add info about MAT_STEPPER_GLOBAL_OPTIONS
1 parent f0376e6 commit 8ff6fc8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/lib/stepper/stepper.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ by placing a `matStepperIcon` for each of the icons that you want to override. T
157157
Note that you aren't limited to using the `mat-icon` component when providing custom icons.
158158

159159
#### 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.
161161

162162
```html
163163
<mat-horizontal-stepper>
@@ -188,6 +188,35 @@ You can set the state of a step to whatever you want. The given state by default
188188
</mat-horizontal-stepper>
189189
```
190190

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+
191220
### Keyboard interaction
192221
- <kbd>LEFT_ARROW</kbd>: Focuses the previous step header
193222
- <kbd>RIGHT_ARROW</kbd>: Focuses the next step header

0 commit comments

Comments
 (0)