react-native-animated-radio-button
Version:
Fully customizable animated radio button for React Native
104 lines (73 loc) • 3.59 kB
Markdown
<img alt="React Native Animated Radio Button" src="assets/logo.png" width="1050"/>
[](https://github.com/WrathChaos/react-native-animated-radio-button)
[](https://github.com/WrathChaos/react-native-animated-radio-button)
[](https://www.npmjs.com/package/react-native-animated-radio-button)
[](https://www.npmjs.com/package/react-native-animated-radio-button)

[](https://opensource.org/licenses/MIT)
[](https://github.com/prettier/prettier)
<p align="center">
<img alt="React Native Animated Radio Button" src="assets/Screenshots/react-native-animated-radio-button.gif" />
</p>
# 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:
```bash
npm i react-native-animated-radio-button
```
## Peer Dependencies
###### IMPORTANT! You need install them
```js
"@freakycoder/react-native-bounceable": ">= 0.2.5",
```
# Usage
## Import
```jsx
import RadioButton from "react-native-animated-radio-button";
```
## Basic Usage
You can check the example out 😏
```jsx
<RadioButton
onPress={(isActive: boolean) =>
console.log("RadioButton isActive: ", isActive)
}
/>
```
## Customization Usage
```jsx
<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
- [x] ~~LICENSE~~
- [x] ~~Horizontal & Vertical text component as optional~~
- [x] ~~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.
```
```