

Customized toggle button input for react native and expo
source link: https://reactnativeexample.com/customized-toggle-button-input-for-react-native-and-expo/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

🔛 React Native Custom Toggle Input
🟢 Customizable React Native Toggle Switch with easy to use props”
Toggle Input Demo
Customizable and Easy to use toggle switch.
- Use the color of your choice
- Use bordered or filled toggle switch upon your choice
- Works on all the platforms Android, Ios and Web in the same way
- Zero dependencies
Compatibility
iOS | Android | Web | Expo |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
🔌 Installation
$ npm install react-native-toggle-input
$ yarn add react-native-toggle-input
😎 Basic Usage
import Toggle from 'react-native-toggle-input'
const App = () => {
const [toggle, setToggle] = React.useState(false);
return(
<Toggle toggle={toggle} setToggle={setToggle} />
)
};
For Live Demo
(Expo Snack)
⭐ Props
Name | Type | Description |
---|---|---|
color | String | Color of the toggle switch (Optional) |
size | Number | Size of the toggle switch (Optional) |
filled | boolean | If you want to use filled toggle switch set it to true (Optional) |
circleColor | String | Use the color you want to give to the circle inside swith (Required for filled switch) |
toggle | boolean | Default value of the toggle switch (Required) |
setToggle | Function | Pass the function that will be used to set toggle status (Required) |
😎 Advanced Usage
import Toggle from 'react-native-toggle-input'
const App = () => {
const [toggle, setToggle] = React.useState(false);
return(
<Toggle
color={"#4C956C"}
size={30}
filled={true}
circleColor={"white"}
toggle={toggle}
setToggle={setToggle}
/>
)
};
Toggle Input Filled Demo
For Live Demo
(Expo Snack)
GitHub
Recommend
-
12
Multi Screen Starter with Expo react native / expo / react navigation v4.
-
8
In this article, we are going to create a Toggle/Switch button in React using hooks. We are using the CRA( create-react-app ) to set up our react project without any efforts. You can find the complete source code for this toggle button at the...
-
17
Uber: UI Clone with Expo Uber UI Clone with React Native & Expo. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or ya...
-
34
Neumorphism with Expo Neumorphism with expo and react native. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or yarn inst...
-
15
movie-react-native-app Ejemplo de react native movie app, basado en The movie Database API y Expo cli. ...
-
8
react-native-mask-text This is a library to mask Text and Input components in React Native and Expo (Android, iOS and Web). Install yarn add react-native-mask-text Shell...
-
14
Slack Clone with Expo Slack UI Clone with React Native & Expo. Install & Build First, make sure you have Expo CLI installed: npm install -g expo-cli Install: yarn or yarn...
-
7
Musicont React Native & Expo music player application UI. Installation First, make sure you have Expo CLI installed: npm install -g expo-cli Clone: git clone ht...
-
5
react-native-select-dropdown react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms. Installation # Using npm
-
6
🚩 React Native Easy Alert React Native Easy Alert Component. Watch on youtubeEasy Alert example app. React Native’s G...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK