1.0.5 • Published 4 years ago
rn-slide-switch v1.0.5
rn-slide-switch
A simple React Native switch with effects
Getting Started
Installation
with NPM
$ npm install rn-slide-switch
Usage
Getting started
How to use it
It's a pretty easy to use this library. This is the usage example :
import React from 'react'
import SlideSwitch from 'rn-slide-switch'
const Preview = () => {
return (
<SlideSwitch
list={['option 1', 'option 2', 'option 3']}
initialIndex={2}
activeViewStyle={{backgroundColor: 'blue'}}
activeTextStyle={{color: 'white'}}
onChange={(i) => console.log(i)}
/>
)
}
Props
propsName | propsType | isRequired | defaultProps |
---|---|---|---|
list | array | true | [] |
initialIndex | number | false | 0 |
activeViewStyle | object | false | {backgroundColor: 'blue'} |
activeTextStyle | object | false | {color: 'white'} |
passiveViewStyle | object | false | {backgroundColor: 'white'} |
passiveTextStyle | object | false | {color: 'black'} |