UNPKG

1.61 kBMarkdownView Raw
1# react-native-material-ripple
2
3Base component for touchable elements
4
5![Example](https://cloud.githubusercontent.com/assets/2055622/23309410/a363975a-fabf-11e6-8cd8-b9c5cca76b63.gif)
6
7## Installation
8
9```bash
10npm install --save react-native-material-ripple
11```
12
13## Usage
14
15```javascript
16import React, { Component } from 'react';
17import { Text } from 'react-native';
18import Ripple from 'react-native-material-ripple';
19
20export default class Example extends Component {
21 render() {
22 return (
23 <Ripple onPress={ () => null }>
24 <Text>touch me</Text>
25 </Ripple>
26 );
27 }
28}
29```
30
31## Properties
32
33* `rippleColor` - Ripple color (default: black)
34* `rippleOpacity` - Ripple opacity (default: 0.3)
35* `rippleDuration` - Ripple duration in ms (default: 400)
36* `rippleSize` - Ripple size restriction (default: 0)
37* `rippleContainerBorderRadius` - Ripple container border radius (default: 0)
38* `rippleCentered` - Ripple always starts from center (default: false)
39* `disabled` - Ripple should ignore touches (default: false)
40* `onPressIn` - Touch moved in or started callback
41* `onPressOut` - Touch moved out or terminated callback
42* `onPress` - Touch up inside bounds callback
43
44## Example
45
46```bash
47git clone https://github.com/n4kz/react-native-material-ripple.git
48cd react-native-material-ripple/example
49npm install
50react-native run-ios # or run-android
51```
52
53## Copyright and License
54
55BSD License
56
57Copyright 2017 Alexander Nazarov. All rights reserved.