react-native-checkbox-reanimated
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-native-checkbox-reanimated

Animated checkbox built with Reanimated v2. This component has been created for the React Native tutorial here.

demo

Prerequisites

Installation

npm install react-native-checkbox-reanimated
npm install react-native-reanimated react-native-svg

Usage

import React, { useState } from 'react'
import { StyleSheet, View, Pressable } from 'react-native'
import AnimatedCheckbox from 'react-native-checkbox-reanimated'

export default function App() {
  const [checked, setChecked] = useState<boolean>(false)

  const handleCheckboxPress = () => {
    setChecked(prev => {
      return !prev
    })
  }

  return (
    <View style={styles.container}>
      <Pressable onPress={handleCheckboxPress} style={styles.checkbox}>
        <AnimatedCheckbox
          checked={checked}
          highlightColor="#4444ff"
          checkmarkColor="#ffffff"
          boxOutlineColor="#4444ff"
        />
      </Pressable>
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center'
  },
  checkbox: {
    width: 64,
    height: 64
  }
})

License

MIT


Looking for a Markdown note-taking app? Check out my app called Inkdrop:

Inkdrop

Package Sidebar

Install

npm i react-native-checkbox-reanimated

Weekly Downloads

103

Version

0.1.1

License

MIT

Unpacked Size

37.8 kB

Total Files

15

Last publish

Collaborators

  • craftzdog