Skip to content

docs(ripple): add section about global options #4239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/lib/core/ripple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,33 @@ By default, a ripple is activated when the host element of the `md-ripple` direc

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

### Global options

### Upcoming work
Developers are able to specify options for all ripples inside of their application.

Ripples will be added to the `md-button`, `md-radio-button`, `md-checkbox`, and `md-nav-list` components.
The speed of the ripples can be adjusted and the ripples can be disabled globally as well.

Global ripple options can be specified by setting the `MD_RIPPLE_GLOBAL_OPTIONS` provider.

```ts
const globalRippleConfig: RippleGlobalOptions = {
disabled: true,
baseSpeedFactor: 1.5 // Ripples will animate 50% faster than before.
}

@NgModule({
providers: [
{provide: MD_RIPPLE_GLOBAL_OPTIONS, useValue: globalRippleConfig}
]
})
```

Here are all available global options listed:

| Name | Type | Description |
| --------------- | ------- | ----------------------------------------- |
| disabled | boolean | Whether ripples should show or not. |
| baseSpeedFactor | number | Factor to adjust ripple speed. |

### API Summary

Expand Down