1.0.10 • Published 4 months ago

react-native-animated-segment-control v1.0.10

Weekly downloads
51
License
MIT
Repository
github
Last release
4 months ago

React Native Animated Segmented Control 🚀

Animated segment control for react native.

Demo

Installation

npm install --save react-native-animated-segment-control
yarn add react-native-animated-segment-control

Usage

import SegmentContorl from 'react-native-animated-segment-control';

render() {
  return (
    <View style={styles.mainContainer}>
      <SegmentControl
        values={['Segment1', 'Segment2', 'Segment3']}
        onChange={(currentIndex) => {}}
        disable={false}
        selectedIndex={1}
      />
    </View>
  )
}

Properties

PropTypeDescription
disableBooleanEnable / Disable the entire component. Default is false.
valuesArray(String)The labels for the control's segment buttons, in order.
onChangefunctionCallback that is called when the user taps a segment.
selectedIndexNumberIndex of the selected segment.
offsetHeightNumberActive Segment's offset height.
styleStylesStyles props of segment control.
segmentControlStyleStylesStyles props of segment control.
activeSegmentStyleStylesStyles props of active segment view.
selectedTextStyleStylesSelected Segment's text style.
unSelectedTextStyleStylesUnselected Segment's text style.

License

MIT