1.0.1 • Published 5 years ago

react-native-easy-action-buttons v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

React Native Easy Action Buttons 🚀

Easy switchable actions buttons in react native.

demo

Installation

npm install --save react-native-easy-action-buttons
yarn add react-native-easy-action-buttons

Usage

import EasyActionButton from 'react-native-easy-action-buttons';

const actionButtons = [
  { type: 'type1', title: 'Title 1', initials: 'A' },
  { type: 'type2', title: 'Title 2', initials: 'B' },
  { type: 'type3', title: 'Title 3', initials: 'C' },
  { type: 'type4', title: 'Title 4', initials: 'D' }
]

render() {
  return (
    <View style={styles.mainContainer}>
      <EasyActionButton buttons={actionButtons} mainIndex={1} onChange={this.onChange} />
    </View>
  )
}

Properties

PropTypeDescription
buttonsArray(Object)Major data source.
mainIndexNumberIndex of the item to begin with default.
onChangefunctionCallback that is called when the user taps a button.

License

MIT