Code Monkey home page Code Monkey logo

react-native-animated-radio-button's Introduction

React Native Animated Radio Button

Battle Tested โœ…

Fully customizable animated radio button for React Native

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

React Native Animated Radio Button

Version 2 is here ๐Ÿ˜

Finally, version 2 is here with much basic usage and re-written code. It does not support a text but it is easy to add a text depends on the dev Typescript support and much cleaner code

Installation

Add the dependency:

npm i react-native-animated-radio-button

Peer Dependencies

IMPORTANT! You need install them
"@freakycoder/react-native-bounceable": ">= 0.2.5",

Usage

Import

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

Basic Usage

You can check the example out ๐Ÿ˜

<RadioButton
  onPress={(isActive: boolean) =>
    console.log("RadioButton isActive: ", isActive)
  }
/>

Customization Usage

<RadioButton
  style={{
    marginTop: 32,
    borderRadius: 16,
    borderWidth: 3,
    borderColor: "#328da8",
  }}
  innerBackgroundColor="#328da8"
  innerContainerStyle={{ height: 35, width: 35, borderRadius: 10 }}
  onPress={(isActive: boolean) => console.log("isActive: ", isActive)}
/>

Configuration - Props

Property Type Default Description
style style default set the main container's style (outer circle)
innerContainerStyle style default set the inner container's style (inner circle)
innerBackgroundColor color red change the inner circle's background color
initial boolean undefined set the initial activation of the radio button
isActive boolean undefined this will disable the built-in state of activation
onPress function default set your own function 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, [email protected]

License

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


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.