Skip to content

Commit

Permalink
Better UX, inside icon is customizable now
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Mar 16, 2020
1 parent 41f3898 commit 7b16cfe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<img alt="React Native Bouncy Checkbox" src="assets/logo.png" width="1050"/>


[![Battle Tested ✅](https://img.shields.io/badge/-Battle--Tested%20%E2%9C%85-03666e?style=for-the-badge)](https://github.com/WrathChaos/react-native-bouncy-checkbox)


[![Fully customizable animated bouncy checkbox for React Native](https://img.shields.io/badge/-Fully%20customizable%20animated%20bouncy%20checkbox%20for%20React%20Native-lightgrey?style=for-the-badge)](https://github.com/WrathChaos/react-native-bouncy-checkbox)


[![npm version](https://img.shields.io/npm/v/react-native-bouncy-checkbox.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-bouncy-checkbox)
[![npm](https://img.shields.io/npm/dt/react-native-bouncy-checkbox.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-bouncy-checkbox)
![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-blue.svg?style=for-the-badge)
Expand Down Expand Up @@ -47,14 +44,14 @@ npm i react-native-bouncy-checkbox
import BouncyCheckbox from "react-native-bouncy-checkbox";
```

# Usage
# Usage

## Basic (Default) Usage

```js
<BouncyCheckbox />
```


## Basic Usage

```jsx
Expand All @@ -66,7 +63,6 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
/>
```


## Advanced Custom Usage

```jsx
Expand All @@ -86,7 +82,6 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
/>
```


### Configuration - Props

| Property | Type | Default | Description |
Expand All @@ -103,7 +98,10 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
| unfillColor | color | transparent | change the checkbox's un-filled color when it's not checked |
| iconComponent | component | Icon | set your own icon component |
| onPress | function | null | set your own onPress functionality after the bounce effect |

| iconSize | number | 15 | change the react-native-vector-icons' size |
| iconName | string | check | change the react-native-vector-icons' name |
| iconType | string | Entypo | change the react-native-vector-icons' type |
| iconColor | string | #fdfdfd | change the react-native-vector-icons' color |

### Future Plans

Expand Down
27 changes: 19 additions & 8 deletions lib/src/BouncyCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class BouncyCheckbox extends Component {
fillColor,
borderRadius,
unfillColor,
iconComponent
iconComponent,
iconName,
iconSize,
iconType,
iconColor
} = this.props;
return (
<Animated.View
Expand All @@ -57,11 +61,10 @@ class BouncyCheckbox extends Component {
>
{iconComponent || (
<Icon
{...this.props}
name="check"
type="Entypo"
size={15}
color="white"
size={iconSize}
name={iconName}
type={iconType}
color={iconColor}
/>
)}
</Animated.View>
Expand Down Expand Up @@ -104,7 +107,11 @@ BouncyCheckbox.propTypes = {
checkboxSize: PropTypes.number,
borderColor: PropTypes.string,
fillColor: PropTypes.string,
unfillColor: PropTypes.string
unfillColor: PropTypes.string,
iconName: PropTypes.string,
iconSize: PropTypes.number,
iconType: PropTypes.string,
iconColor: PropTypes.string
};

BouncyCheckbox.defaultProps = {
Expand All @@ -116,7 +123,11 @@ BouncyCheckbox.defaultProps = {
textColor: "#757575",
fillColor: "#ffc484",
borderColor: "#ffc484",
unfillColor: "transparent"
unfillColor: "transparent",
iconName: "check",
iconSize: 15,
iconType: "Entypo",
iconColor: "#fdfdfd"
};

export default BouncyCheckbox;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-bouncy-checkbox",
"version": "0.0.5",
"version": "0.1.0",
"description": "Fully customizable animated bouncy checkbox for React Native",
"keywords": [
"bouncy",
Expand Down

0 comments on commit 7b16cfe

Please sign in to comment.