1.1.3 • Published 4 months ago

rn-switcher v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

rn-switcher

A simple draggable switch component for React Native that supports text and svg

Demo

Getting started

yarn add rn-switcher

Usage

...
import Switch from 'rn-switcher';

...
render() {
  ...
  return (
    <Switch 
      leftContent="Off"
      rightContent="On"
    />
  )
}
...

Props Definitions

<Switch />

PropExplanationTypeDefaultRequired
leftContentText/Icon on the left side of switchstring/React.Node""false
rightContentText/Icon on the left side of switchstring/React.Node""false
valueThe value of the switch, indicating if the switch is on or offbooleantrue
onChangeThe callback function for when the value is changed in Switch, providing the updated value in paramsfunctiontrue
disabledIf user touch is disabledbooleanfalsefalse
containerStylesStyle for Switch containerStyleSheetnullfalse
buttonStylesStyle for selectable buttonsStyleSheetnullfalse
switchStyleStyle for the circle of the switchStyleSheetnullfalse
backgroundColorBackground color of the Switch when it is not onstring'#F3F4F6'false
switchColorColor of the switch circlestring'black'false
textColorColor of the text/svg when it is activestring'white'false
disabledColorBackground color of the Switch when it is disabledstring'#A1A1A1'false
1.1.3

4 months ago

1.1.2

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago