1.1.1 • Published 7 years ago

react-native-multi-toggle-switch v1.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

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.

<MultiToggleSwitch>
  <MultiToggleSwitch.Item onPress={() => console.log("Facebook tapped!")}>
      <Icon name={'facebook'} size={30} />
  </MultiToggleSwitch.Item>
  <MultiToggleSwitch.Item primaryColor={'#CF4647'}>
      <Icon name={'twitter'} size={30} />
  </MultiToggleSwitch.Item>
  <MultiToggleSwitch.Item>
      <Icon name={'instagram'} size={30}/>
  </MultiToggleSwitch.Item>
  <MultiToggleSwitch.Item primaryColor={'orange'}>
      <Icon name={'github'} size={30} />
  </MultiToggleSwitch.Item>
</MultiToggleSwitch>

API

PropertyTypeDefaultDescription
defaultActiveIndexnumber0Item index which should be active when the component renders
primaryColorstring#124E96Color of icon when in non-active state & Color of icon background when in active state
secondaryColorstringwhiteColor of icon when in active state & Color of icon background when in non-active state
itemContainerstylenullStyle of item container
activeContainerStylestylenullStyle of item container when active
itemsContainerstylenullStyle of container containing all items
itemsContainerBackgroundStylestylenullBackground Style of container containing items
onPressfunctionFunction to be called as soon as the user presses any item

TODO

  • Example
  • Able to use all icons(only FontAwesome Supported)
1.1.1

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.9.0

7 years ago