1.0.5 • Published 4 years ago

rn-slide-switch v1.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

rn-slide-switch

A simple React Native switch with effects

Version Downloads/week License All Contributors oclif

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

propsNamepropsTypeisRequireddefaultProps
listarraytrue[]
initialIndexnumberfalse0
activeViewStyleobjectfalse{backgroundColor: 'blue'}
activeTextStyleobjectfalse{color: 'white'}
passiveViewStyleobjectfalse{backgroundColor: 'white'}
passiveTextStyleobjectfalse{color: 'black'}

Contributors ✨

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago