Skip to content

Commit 49c91d3

Browse files
committed
New screenshot and GIF are added. Fonts are added on example
1 parent dd376a1 commit 49c91d3

36 files changed

+240
-87
lines changed

README.md

Lines changed: 31 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
1111
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)
1212

13-
<p align="center">
14-
<img alt="React Native Bouncy Checkbox"
15-
src="assets/Screenshots/example.gif" width="49%" height="715"/>
16-
<img alt="React Native Bouncy Checkbox"
17-
src="assets/Screenshots/example.png" width="49%" />
18-
</p>
13+
<table>
14+
<tr>
15+
<td align="center">
16+
<img alt="React Native Bouncy Checkbox"
17+
src="assets/Screenshots/react-native-bouncy-checkbox.gif" />
18+
</td>
19+
<td align="center">
20+
<img alt="React Native Bouncy Checkbox"
21+
src="assets/Screenshots/react-native-bouncy-checkbox.png" />
22+
</td>
23+
</tr>
24+
</table>
1925

2026
## Installation
2127

@@ -27,7 +33,7 @@ Add the dependency:
2733
npm i react-native-bouncy-checkbox
2834
```
2935

30-
## Version 1.0.0 is Here 🥳
36+
## Version 2.0.0 is Here 🥳
3137

3238
- Typescript
3339
- **Zero Dependency**
@@ -44,70 +50,49 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
4450
## Basic Usage
4551

4652
```js
47-
<BouncyCheckbox />
48-
```
49-
50-
## Basic Usage
51-
52-
```jsx
53-
<BouncyCheckbox
54-
isChecked
55-
textColor="#000"
56-
fillColor="red"
57-
text="Buy tickets for concert 🎉 🎊"
58-
onPress={(checked) => console.log("Checked: ", checked)}
59-
/>
53+
<BouncyCheckbox onPress={(isChecked: boolean) => {}} />
6054
```
6155

6256
## Advanced Custom Usage
6357

6458
```jsx
6559
<BouncyCheckbox
66-
isChecked={false}
67-
textColor="#000"
68-
unfillColor="white"
69-
text="Custom Icon Example"
70-
fontFamily="JosefinSans-Regular"
71-
onPress={(checked) => console.log("Checked: ", checked)}
72-
iconComponent={
73-
<FastImage
74-
style={{ height: 10, width: 10 }}
75-
source={require("./assets/checkmark.png")}
76-
/>
77-
}
60+
size={25}
61+
fillColor="red"
62+
unfillColor="#FFFFFF"
63+
text="Custom Checkbox"
64+
iconStyle={{ borderColor: "red" }}
65+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
66+
onPress={(isChecked: boolean) => {}}
7867
/>
7968
```
8069

8170
### Configuration - Props
8271

8372
| Property | Type | Default | Description |
8473
| -------------------- | :-------: | :------------: | ----------------------------------------------------------- |
85-
| borderWidth | number | 1 | border width of the checkbox |
86-
| borderRadius | number | 20 | border radius of the checkbox |
87-
| borderColor | string | #ffc484 | border color of the checkbox |
74+
| text | string | Call my mom 😇 | set the checkbox's text |
75+
| onPress | function | null | set your own onPress functionality after the bounce effect |
76+
| disableText | boolean | false | if you want to use checkbox without text, you can enable it |
8877
| size | number | 25 | size of `width` and `height` of the checkbox |
78+
| style | style | default | set/override the container style |
79+
| textStyle | style | default | set/override the text style |
80+
| iconStyle | style | default | set/override the icon style |
8981
| isChecked | boolean | false | set the default checkbox value |
82+
| fillColor | color | #f09f48 | change the checkbox's filled color |
9083
| unfillColor | color | transparent | change the checkbox's un-filled color when it's not checked |
9184
| useNativeDriver | boolean | true | enable/disable the useNativeDriver for animation |
92-
| text | string | Call my mom 😇 | set the checkbox's text |
93-
| textColor | color | #757575 | change the text's color |
94-
| fontSize | number | 16 | change the text's font size |
95-
| fillColor | color | #f09f48 | change the checkbox's filled color |
96-
| textStyle | object | default | set your own text style |
97-
| textDecoration | boolean | false | enable/disable text decoration for Text |
98-
| onPress | function | null | set your own onPress functionality after the bounce effect |
9985
| iconComponent | component | Icon | set your own icon component |
100-
| iconStyle | object | default | set your own icon style |
10186
| checkIconImageSource | image | default | set your own check icon image |
102-
| checkImageWidth | number | 10 | change the check icon's width |
103-
| checkImageHeight | number | 10 | change the check icon's height |
10487
| ImageComponent | component | Image | set your own Image component instead of RN's default Image |
105-
| disableText | boolean | false | if you want to use checkbox without text, you can enable it |
88+
| bounceEffect | number | 1 | change the bounce effect |
89+
| bounceFriction | number | 3 | change the bounce friction |
10690

10791
### Future Plans
10892

10993
- [x] ~~LICENSE~~
11094
- [x] ~~Typescript Challange!~~
95+
- [x] ~~Version 2.0.0 is alive 🥳~~
11196
- [ ] Write an article about the lib on Medium
11297

11398
## Author

assets/Screenshots/example.gif

-5.73 MB
Binary file not shown.

assets/Screenshots/example.png

-371 KB
Binary file not shown.
22.3 MB
Loading
2.24 MB
Loading

example/App.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import { View, Text, StatusBar, SafeAreaView } from "react-native";
33
import AppleHeader from "react-native-apple-header";
44
import BottomSearchBar from "react-native-bottom-search-bar";
5-
import BouncyCheckbox from "./lib/BouncyCheckbox";
5+
import BouncyCheckbox from "react-native-bouncy-checkbox";
66

77
const App = () => {
88
return (
@@ -11,13 +11,11 @@ const App = () => {
1111
<SafeAreaView style={{ flex: 1 }}>
1212
<AppleHeader />
1313
<View style={{ margin: 16 }}>
14-
<View style={{ margin: 8 }}>
15-
<BouncyCheckbox isChecked disableText onPress={() => {}} />
16-
</View>
1714
<View style={{ margin: 8 }}>
1815
<BouncyCheckbox
1916
size={25}
2017
fillColor="red"
18+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
2119
iconStyle={{ borderColor: "red" }}
2220
unfillColor="#FFFFFF"
2321
text="Custom Checkbox"
@@ -29,6 +27,7 @@ const App = () => {
2927
disabled
3028
isChecked={false}
3129
iconStyle={{ borderColor: "blue", borderRadius: 10 }}
30+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
3231
unfillColor="white"
3332
borderRadius={10}
3433
text="Custom Disabled Checkbox Example"
@@ -38,48 +37,59 @@ const App = () => {
3837
<View style={{ margin: 8 }}>
3938
<BouncyCheckbox
4039
text="Call my mom 😇"
40+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
4141
onPress={(checked: boolean) => {
4242
alert(checked);
4343
}}
4444
/>
4545
</View>
4646
<View style={{ margin: 8 }}>
4747
<BouncyCheckbox
48+
isChecked
4849
text="Get groceries"
50+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
4951
onPress={(isChecked: boolean) => {}}
5052
/>
5153
</View>
5254
<View style={{ margin: 8 }}>
5355
<BouncyCheckbox
5456
isChecked
5557
text="Pay the bills"
58+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
5659
onPress={(isChecked: boolean) => {}}
5760
/>
5861
</View>
5962
<View style={{ margin: 8 }}>
6063
<BouncyCheckbox
6164
text="Take out of the trash 💩"
65+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
6266
onPress={(isChecked: boolean) => {}}
6367
/>
6468
</View>
6569
<View style={{ margin: 8 }}>
6670
<BouncyCheckbox
6771
text="Buy tickets for concert 🎉 🎊"
72+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
6873
onPress={(isChecked: boolean) => {}}
6974
/>
7075
</View>
7176
<View style={{ margin: 8 }}>
7277
<BouncyCheckbox
7378
isChecked
7479
text="Try new gym routine"
75-
textStyle={{ color: "red", textDecorationLine: "none" }}
80+
textStyle={{
81+
fontFamily: "JosefinSans-Regular",
82+
color: "red",
83+
textDecorationLine: "none",
84+
}}
7685
onPress={(isChecked: boolean) => {}}
7786
/>
7887
</View>
7988
<View style={{ margin: 8 }}>
8089
<BouncyCheckbox
8190
isChecked
8291
text="Do a load of laundry"
92+
textStyle={{ fontFamily: "JosefinSans-Regular" }}
8393
onPress={(isChecked: boolean) => {}}
8494
/>
8595
</View>
@@ -89,7 +99,14 @@ const App = () => {
8999
marginTop: 16,
90100
}}
91101
>
92-
<Text style={{ marginLeft: 24, fontSize: 24, fontWeight: "700" }}>
102+
<Text
103+
style={{
104+
marginLeft: 24,
105+
fontSize: 24,
106+
fontWeight: "700",
107+
fontFamily: "JosefinSans-Regular",
108+
}}
109+
>
93110
Checkbox Only
94111
</Text>
95112
<View

0 commit comments

Comments
 (0)