Skip to content

rafaelmrdyn/rn-slide-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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

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'}

Contributors ✨

Rafael Muradyan
Rafael Muradyan

💻

About

A simple React Native switch with effects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published