Skip to content

1mehdifaraji/react-native-switch-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-switch-ios

React native iOS switch component that can be used in android and iOS projects with active and inactive color customization and cool iOS toggle animation .

Preview

Installation

$ npm install --save react-native-switch-ios

or

yarn add react-native-switch-ios

or

pnpm add react-native-switch-ios

Usage

import { useState } from "react";
import { Switch } from "react-native-switch-ios";

export const App = () => {
  const [toggle, setToggle] = useState(false);
  return (
      <Switch
         inactiveBgColor="#7d7d7d"
         activeBgColor="#34c759"
         isOn={toggle}
         onToggle={() => setToggle((prev) => !prev)} 
      />
  )
};

Developer

@1mehdifaraji