Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiok46/react-native-multi-toggle-switch
MultiToggle Switch for React-Native
https://github.com/kiok46/react-native-multi-toggle-switch
npm-package react-native switch
Last synced: 16 days ago
JSON representation
MultiToggle Switch for React-Native
- Host: GitHub
- URL: https://github.com/kiok46/react-native-multi-toggle-switch
- Owner: kiok46
- License: mit
- Created: 2017-10-01T14:29:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-06T13:36:19.000Z (about 7 years ago)
- Last Synced: 2024-10-16T01:20:01.506Z (28 days ago)
- Topics: npm-package, react-native, switch
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-native-multi-toggle-switch
- Size: 10.7 KB
- Stars: 18
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-multi-toggle-switch
MultiToggle Switch for React-Native
### Installation
```
npm i react-native-multi-toggle-switch --save
```
Link `react-native-vector-icons` native dependencies to your project with:
```
react-native link react-native-vector-icons
```
or just:
```
react-native link
```## Usage
**First step:** import the component:
```
import MultiToggleSwitch from 'react-native-multi-toggle-switch';
```**Second step:** Use it.
```
console.log("Facebook tapped!")}>
```
## API
| Property | Type | Default | Description |
|--------------|----------|-----------------------|------------------------------------------------------------------------------------------------------------|
| defaultActiveIndex | number | 0 | Item index which should be active when the component renders |
| primaryColor | string | #124E96 | Color of icon when in non-active state & Color of icon background when in active state |
| secondaryColor | string | white | Color of icon when in active state & Color of icon background when in non-active state |
| itemContainer | style | null | Style of item container |
| activeContainerStyle | style | null | Style of item container when active |
| itemsContainer | style | null | Style of container containing all items |
| itemsContainerBackgroundStyle | style | null | Background Style of container containing items |
| onPress | function | | Function to be called as soon as the user presses any item |## TODO
- [x] Example
- [x] Able to use all icons(only FontAwesome Supported)