Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
toggle-switch-react-native
Advanced tools
Toggle Switch component for react native, it works on iOS and Android.
Toggle Switch Component for react native, it works on iOS and Android.
npm i toggle-switch-react-native --save
import ToggleSwitch from 'toggle-switch-react-native'
To Get Started, Import toggle-switch-react-native
to your js file.
import ToggleSwitch from 'toggle-switch-react-native'
Inside your component's render method, or any other method returning views, use ToggleSwitch:
<ToggleSwitch
isOn={false}
onColor="green"
offColor="red"
label="Example label"
labelStyle={{ color: "black", fontWeight: "900" }}
size="large"
onToggle={isOn => console.log("changed to : ", isOn)}
/>
Props | Type | Optional | Default | Description |
---|---|---|---|---|
isOn | Boolean | true | 'false' | Default state, true for On, false for off |
onColor | String | true | '#634fc9' | On Color |
offColor | String | true | '#ecf0f1' | Off Color |
label | String | true | Custom Label Text on the Left of the toggle Button | |
labelStyle | Object | true | {marginHorizontal: 10} | Custom Styling for the Label Text View |
size | String | true | 'medium' | Size of the toggle switch button ( 'large', 'medium', 'small') |
icon | React Component | true | null | Icon for the toggle. Can be any React Component considerate of size |
onToggle | Function Callback | false | none | Callback when the toggle switch component changes the state, params: isOn |
disabled | Boolean | true | 'false' | Disable toggling the component |
If you encountered an Issue, please add a screenshot of the bug or a code snippet.
Quickest way to solve issue is to reproduce it on the example project
Pull requests are welcome. If you want to change the API or imporove something, feel free to create an issue and discuss it first.
MIT Licensed
FAQs
Toggle Switch component for react native, it works on iOS and Android.
The npm package toggle-switch-react-native receives a total of 8,877 weekly downloads. As such, toggle-switch-react-native popularity was classified as popular.
We found that toggle-switch-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.