1.0.5 • Published 3 years ago

react-native-circle-checkbox-with-icon v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Example code

import { StatusBar } from 'expo-status-bar'; import React, {useState} from 'react'; import { StyleSheet, Text, View } from 'react-native'; import CircleCheckBox, {LABEL_POSITION} from 'react-native-circle-checkbox';

export default function App() { //store value of checkbox

const checked,setChecked=useState(false);

const toggleSwitch1 = (value) => { //onValueChange of the chechbox this function will be called

setChecked((previousState) => !previousState);

console.log(value);


//state changes according to switch
//which will result in re-render the text

};

return ( <CircleCheckBox checked={checked} outerSize={100} innerSize={95} filterSize={90} unCheckedColor= '#fc2384', checkedColor='#CD0923', outerColor='#0C9527' innerColor="#FC9527" filterColor = '#FFFFFF' onToggle={(checked) => toggleSwitch1(checked)} labelPosition={LABEL_POSITION.BOTTOM} styleLabel= {{}} /> ); }

const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });

JSX props to follow shrtly