1.0.9 • Published 5 years ago

switch-react-native v1.0.9

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Switch React Native

Content

Installation

npm install switch-react-native

Usage example

import React, { Component } from 'react';
import { View } from 'react-native';
import { Switch } from 'switch-react-native';

class SwitchExample extends Component {
  render() {
    return (
      <View>
        <Switch
          height={40}
          width={300}
          activeText={`Active Text`}
          inActiveText={`InActive Text`}
          onValueChange={(value: any) => console.log(value)}
        />
      </View>
    );
  }
}

Properties

  • width (Number) - Initial switch state (default: 150),
  • height (Number) - Initial switch state (default: 50),
  • time (Number) - Initial switch state (default: 200 mms),
  • value (Bool) - Initial switch state (default: false),
  • activeText (String) - String activeText,
  • inActiveText (String) - String inActiveText,
  • activeTextStyle (Object) - Style is object,
  • inActiveTextStyle (Object) - Style is object,
  • activeStyle (Object) - Style is object,
  • backgroundStyle (Object) - Style is object,

Events

  • onValueChange: This function is called when the switch is activated.

License

MIT License

Questions?

Feel free to create an issue

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago