# switch-react-native

> Switch in react native

Latest version **1.0.9** (published 2019-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install switch-react-native
pnpm add switch-react-native
yarn add switch-react-native
bun add switch-react-native
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2019-03-15 |
| First published | 2017-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tinh Ngo |
| Maintainers | jundat95 |
| Keywords | switch-react-native, react-native, react, switch, switch |

## Links

- npm: https://www.npmjs.com/package/switch-react-native
- Repository: https://github.com/jundat95/switch-react-native
- Homepage: https://github.com/jundat95/switch-react-native#readme
- Issues: https://github.com/jundat95/switch-react-native/issues
- npm.io page: https://npm.io/package/switch-react-native

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2019-03-15
- 1.0.8 — 2018-10-29
- 1.0.7 — 2017-09-04
- 1.0.6 — 2017-09-04
- 1.0.5 — 2017-08-12
- 1.0.4 — 2017-08-11
- 1.0.3 — 2017-08-11
- 1.0.2 — 2017-08-11
- 1.0.1 — 2017-08-11
- 1.0.0 — 2017-08-11

## README

## Switch React Native

<p align="center">
    <img src ="https://media.giphy.com/media/EP7FFmBKLhfq3n8pLo/giphy.gif" />
</p>

### Content
- [Switch React Native](#switch-react-native)
  - [Content](#content)
  - [Installation](#installation)
  - [Usage example](#usage-example)
  - [Properties](#properties)
  - [Events](#events)
  - [License](#license)
  - [Questions?](#questions)

### Installation
```bash
npm install switch-react-native
```
### Usage example
```javascript
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](https://github.com/jundat95/switch-react-native/issues)

---
_Source: https://npm.io/package/switch-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
