1.0.1 • Published 6 years ago

react-native-pushable v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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

N|Solid

Props

PropsdescriptiontypeisRequireddefaultValue
scalecontrols the scale of the element when pushed. (1 being the normal size. Anything greater or lesser is multiplied with the original)numberfalse0.95

All touchableWithoutFeedback props are supported

License

MIT