Skip to content

Commit 74e1cba

Browse files
committed
docs: add withRipple() docs
1 parent aaadc7f commit 74e1cba

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const MyComponent = mock();
7777
- [`<Portal>`](./docs/en/Portal.md), [`<Overlay>`](./docs/en/Overlay.md), and [`<Modal>`](./docs/en/Modal.md)
7878
- [`<FullScreen>`](./docs/en/FullScreen.md)
7979
- [`<Slider>`](./docs/en/Slider.md)
80-
- [`<Ripple>`](./docs/en/Ripple.md) &mdash; [**example**](https://codesandbox.io/s/983q7jr80o)
80+
- [`<Ripple>`](./docs/en/Ripple.md) and [`withRipple`](./docs/en/Ripple.md#withripple) &mdash; [**example**](https://codesandbox.io/s/983q7jr80o)
8181
- [`<Audio>`](./docs/en/Audio.md) and [`<Video>`](./docs/en/Video.md)
8282
- [`<Speak>`](./docs/en/Speak.md), [`<Vibrate>`](./docs/en/Vibrate.md), [`<Alert>`](./docs/en/Alert.md), `<Prompt>`, `<Confirm>`
8383
- [Side Effects](./docs/en/Side-effects.md)

docs/en/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
- [`<Portal>`](./Portal.md), [`<Overlay>`](./Overlay.md), and [`<Modal>`](./Modal.md)
4747
- [`<FullScreen>`](./FullScreen.md)
4848
- [`<Slider>`](./Slider.md)
49-
- [`<Ripple>`](./Ripple.md)
49+
- [`<Ripple>`](./Ripple.md) and [`withRipple`](./Ripple.md#withripple) &mdash; [**example**](https://codesandbox.io/s/983q7jr80o)
5050
- [`<Audio>`](./Audio.md) and [`<Video>`](./Video.md)
5151
- [`<Speak>`](./Speak.md), [`<Vibrate>`](./Vibrate.md), [`<Alert>`](./Alert.md), `<Prompt>`, `<Confirm>`
5252
- [Side Effects](./Side-effects.md)

docs/en/Ripple.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@ import {Ripple} from 'libreact/lib/Ripple';
2323

2424
- `color` &mdash; optional, string, ripple color.
2525
- `ms` &mdash; optional, number, animation time in milliseconds.
26+
27+
28+
## `withRipple()`
29+
30+
A higher order component that transforms plain DOM type elements into ones with ripple effects.
31+
32+
```js
33+
import {withRipple} from 'libreact/lib/Ripple';
34+
35+
const DivWithRipple = withRipple('div');
36+
const ButtonWithRipple = withRipple('button', {ms: 1000, color: red});
37+
```
38+
39+
As an optional second arguments accepts props to provide to `<Ripple>` component.

0 commit comments

Comments
 (0)