drmas / react-native-switch

Customisable switch component for RN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-switch

Customisable switch component for RN

Installation

$ npm install --save react-native-switch

or

yarn add react-native-switch

Usage

import { Switch } from 'react-native-switch';

export const App = () => (
  <Switch
    value={true}
    onValueChange={(val) => console.log(val)}
    disabled={false}
    activeText={'On'}
    inActiveText={'Off'}
    circleSize={30}
    barHeight={1}
    circleBorderWidth={3}
    backgroundActive={'green'}
    backgroundInactive={'gray'}
    circleActiveColor={'#30a566'}
    circleInActiveColor={'#000000'}
  />
)

Switch

switch

About

Customisable switch component for RN

License:MIT License


Languages

Language:JavaScript 100.0%