2.0.6 • Published 3 years ago

react-native-animated-radio-button v2.0.6

Weekly downloads
20
License
MIT
Repository
github
Last release
3 years ago

Battle Tested ✅

Fully customizable animated radio button for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i react-native-animated-radio-button

Peer Dependencies

IMPORTANT! You need install them
"react-native-animatable": ">= 1.3.3"

Usage

Import

import RadioButton from "react-native-animated-radio-button";

Fundamental Usage

You can check the example out 😏

<RadioButton
  size={50}
  isSelected
  animation={"bounceIn"}
  onPress={() => console.log("RadioButton is pressed")}
/>

Configuration - Props

PropertyTypeDefaultDescription
sizenumber16change the size of the radio button
isSelectedbooleanfalseset the selectable of the radio button
isBounceablebooleantrueenable or disable the bounceable effect
innerColorcolordodgerbluechange the radio button's inner circle color
outerColorcolordodgerbluechange the radio button's outer circle color
onPressfunction()set your own function when onPress is triggered
disableBuiltinStateManagementboolfalsedisable the builtin state management to let your state management for the radio button
activeboolfalseyou can use this prop to set the radio button is active or not, this ONLY works when built-in state management is disabled
horizontalbooltruemake the radio button's text horizontal or vertical
fontSizenumber16change the font size
textColorcolorinnerColorchange the text's color
textstringRadio Buttonset your own text for each radio button
disableTextboolfalsedisable the text and only radio button works
customImageComponentcomponentdefaultset your own custom component instead of default Image one

Credits

This library is heavily inspired on react-native-radio-button It is re-written with a modern way. Also it has built-in selection system. The library itself also has a bouncy animation when onPress is triggered.

Future Plans

  • LICENSE
  • Horizontal & Vertical text component as optional
  • Typescript Challenge!
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Animated Radio Button is available under the MIT license. See the LICENSE file for more info.