1.0.2 • Published 7 years ago

react-native-animated-checkbox v1.0.2

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

react-native-animated-checkbox

Minimalistic and customizable component for React Native. You can do things like plug in your own check Icon component, toggle the animation and change the style.


Travis npm npm Issue Stats

Installation

  • yarn add react-native-animated-checkbox

Or, if you prefer using npm:

  • npm i -S react-native-animated-checkbox

Available Props

Check the TypeScript type definition file for further info.

PropTypeDefaultDescription
checkedboolfalseif true, renders the check Icon component
animatedbooltrueif true, animates to opacity of the Icon as checked's value changes
durationnumber300animation duration. Considered only if animated === true
stylestyle of the CheckBox parent container View. Check below for the default style definition
colorstring'#F26F6F'color of the icon, and default color of the parent's borderColor style
iconNamestring'check'name prop of react-native-vector-icons
iconSizenumber15size prop of react-native-vector-icons
activeOpacitynumber0.7activeOpacity prop of TouchableOpacity
onPressfuncnullcallback called when the CheckBox gets pressed.
childrenNodenulloptional Icon component if react-native-vector-icons/FontAwesome doesn't suit your needs.
  const defaultStyle = {
    backgroundColor: 'transparent',
    margin: 2,
    padding: 1,
    borderRadius: 0,
    borderWidth: 2,
    borderColor: this.props.color,
  };

Example (TODO)

Contributing

PRs are obviously welcome! :octocat:

Available scripts

  • lint: verify that the eslint configuration is respected

License

MIT