react-native-pushable
v1.0.1
Published
Use an amazing pushable component in your app. This is a better way yo express touchable components in a completely custom ui theme
Downloads
10
Maintainers
Readme
react-native-pushable
Use a cool pushable element in your react-native app. Escape the ordinary! Embrace the crazy!
Installation
npm i -S react-native-pushable
Usage
import PushableElement from 'react-native-pushable';
export default class Appx extends Component {
state = {
push: 'Push Me'
}
render() {
return (
<View style={{ flex: 1, backgroundColor: '#eee', justifyContent: 'center', alignItems: 'center' }}>
<PushableElement
scale={0.90}
style={{ backgroundColor: 'white', elevation: 5, padding: 10, borderRadius: 10, }}
onPressIn={() => {this.setState({push: 'Pushhhh'})}}
onPressOut={() => {this.setState({push: 'Push Me'})}}
>
<Text style={{ fontSize: 70 }}>{this.state.push}</Text>
</PushableElement>
</View>
)
}
}
Example
Props
| Props | description| type |isRequired |defaultValue | |--|--|--|--|--| | scale | controls the scale of the element when pushed. (1 being the normal size. Anything greater or lesser is multiplied with the original) | number | false | 0.95 |
All touchableWithoutFeedback
props are supported
License
MIT