Skip to content

Commit 3560ada

Browse files
devversionmmalerba
authored andcommitted
docs(ripple): add section about global options (#4239)
* docs(ripple): add section about global options * Adds a new section about global ripple options to the `README.md` file of the ripple directive. Closes #4226 * Update
1 parent f16affc commit 3560ada

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/lib/core/ripple/README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,33 @@ By default, a ripple is activated when the host element of the `md-ripple` direc
66

77
Ripples can also be triggered programmatically by getting a reference to the MdRipple directive and calling its `start` and `end` methods.
88

9+
### Global options
910

10-
### Upcoming work
11+
Developers are able to specify options for all ripples inside of their application.
1112

12-
Ripples will be added to the `md-button`, `md-radio-button`, `md-checkbox`, and `md-nav-list` components.
13+
The speed of the ripples can be adjusted and the ripples can be disabled globally as well.
14+
15+
Global ripple options can be specified by setting the `MD_RIPPLE_GLOBAL_OPTIONS` provider.
16+
17+
```ts
18+
const globalRippleConfig: RippleGlobalOptions = {
19+
disabled: true,
20+
baseSpeedFactor: 1.5 // Ripples will animate 50% faster than before.
21+
}
22+
23+
@NgModule({
24+
providers: [
25+
{provide: MD_RIPPLE_GLOBAL_OPTIONS, useValue: globalRippleConfig}
26+
]
27+
})
28+
```
29+
30+
Here are all available global options listed:
31+
32+
| Name | Type | Description |
33+
| --------------- | ------- | ----------------------------------------- |
34+
| disabled | boolean | Whether ripples should show or not. |
35+
| baseSpeedFactor | number | Factor to adjust ripple speed. |
1336

1437
### API Summary
1538

0 commit comments

Comments
 (0)