Skip to content

Commit 0dcedf5

Browse files
committed
new: Documentation is updated
1 parent 32fa85f commit 0dcedf5

File tree

5 files changed

+99
-134
lines changed

5 files changed

+99
-134
lines changed

README.md

Lines changed: 97 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,131 @@
1-
<img alt="React Native Typescript Library Starter" src="assets/logo.png" width="1050"/>
1+
<img alt="React Native Rounded Checkbox Group" src="assets/logo.png" width="1050"/>
22

3-
[![Battle Tested ✅](https://img.shields.io/badge/-Battle--Tested%20%E2%9C%85-03666e?style=for-the-badge)](https://github.com/WrathChaos/react-native-typescript-library-starter)
3+
[![React Native Rounded Checkbox Group](https://img.shields.io/badge/-Extremely%20easy%20to%20create%20a%20React%20Native%20Component%20Library%20with%20both%20Stateful%20and%20Functional%20Component%20Examples-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-rounded-checkbox-group)
44

5-
[![React Native Typescript Library Starter](https://img.shields.io/badge/-Extremely%20easy%20to%20create%20a%20React%20Native%20Component%20Library%20with%20both%20Stateful%20and%20Functional%20Component%20Examples-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-typescript-library-starter)
6-
7-
[![npm version](https://img.shields.io/npm/v/react-native-typescript-library-starter.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-typescript-library-starter)
8-
[![npm](https://img.shields.io/npm/dt/react-native-typescript-library-starter.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-typescript-library-starter)
5+
[![npm version](https://img.shields.io/npm/v/react-native-rounded-checkbox-group.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-rounded-checkbox-group)
6+
[![npm](https://img.shields.io/npm/dt/react-native-rounded-checkbox-group.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-rounded-checkbox-group)
97
![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-blue.svg?style=for-the-badge)
108
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
119
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)
1210

1311
<p align="center">
14-
<img alt="React Native Typescript Library Starter"
12+
<img alt="React Native Rounded Checkbox Group"
1513
src="assets/Screenshots/typescript.jpg" />
1614
</p>
1715

18-
## Library Usage
19-
20-
- `npm i`
21-
- Delete example folder
22-
- Delete build folder
23-
- Make your own library into the `lib` folder
24-
- Change package.json
25-
- Change README for your own documentation
26-
- `npm run build`
27-
28-
```
29-
> react-native-typescript-library-starter@0.1.0 build /Users/kuray/Coursion/MyLibraries/ReactNative/react-native-typescript-library-starter
30-
> cd lib && tsc && cp ../package.json ../build/dist/ && Echo Build completed!
31-
32-
Build completed!
33-
```
34-
35-
- Test your build/dist into the new project
36-
- Finally, time to npm publish :)
37-
38-
### Below part is for Documentation ! Remove above Library Usage
39-
4016
# Installation
4117

4218
Add the dependency:
4319

4420
```bash
45-
npm i react-native-typescript-library-starter
21+
npm i react-native-rounded-checkbox-group
4622
```
4723

4824
## Peer Dependencies
4925

5026
<h5><i>IMPORTANT! You need install them</i></h5>
5127

5228
```js
53-
"react": ">= 16.x.x",
54-
"react-native": ">= 0.55.x",
29+
"react-native-rounded-checkbox": ">= 0.3.3",
5530
```
5631

5732
# Usage
5833

5934
## Import
6035

6136
```jsx
62-
import MyComponent from "react-native-typescript-library-starter";
37+
import RoundedCheckboxGroup, {
38+
ICheckboxButton,
39+
} from "react-native-rounded-checkbox-group";
6340
```
6441

6542
## Fundamental Usage
6643

6744
```jsx
68-
<MyComponent />
45+
<RoundedCheckboxGroup
46+
data={staticData}
47+
initial={0}
48+
onChange={(selectedItem: ICheckboxButton) => {
49+
setSelectedItem(selectedItem);
50+
}}
51+
/>
52+
```
53+
54+
## Advanced Usage
55+
56+
```jsx
57+
<RoundedCheckboxGroup
58+
data={staticData}
59+
initial={2}
60+
onChange={(selectedItem: ICheckboxButton) => {
61+
setSelectedItem(selectedItem);
62+
}}
63+
component={(isActive: boolean) =>
64+
isActive && <Icon name="check" type="Entypo" color="#fff" />
65+
}
66+
/>
67+
```
68+
69+
## Data format
70+
71+
You MUST follow this data format as `ICheckboxButton`
72+
73+
```json
74+
[
75+
{
76+
id: 0,
77+
},
78+
{
79+
id: 1,
80+
},
81+
{
82+
id: 2,
83+
},
84+
{
85+
id: 3,
86+
},
87+
];
88+
```
89+
90+
## Advanced and Customization Data Format Example
91+
92+
You can find the working/running example on the `example` project
93+
94+
```jsx
95+
const staticData: ICheckboxButton[] = [
96+
{
97+
id: 0,
98+
text: "",
99+
checkedColor: "#ff7473",
100+
uncheckedColor: "#fbbfbb",
101+
outerStyle: _outerStyle("#fbbfbb"),
102+
innerStyle: styles.innerStyle,
103+
},
104+
{
105+
id: 1,
106+
text: "",
107+
checkedColor: "#5567e9",
108+
uncheckedColor: "#afb5f5",
109+
outerStyle: _outerStyle("#afb5f5"),
110+
innerStyle: styles.innerStyle,
111+
},
112+
{
113+
id: 2,
114+
text: "",
115+
checkedColor: "#a98ae7",
116+
uncheckedColor: "#cab6f4",
117+
outerStyle: _outerStyle("#cab6f4"),
118+
innerStyle: styles.innerStyle,
119+
},
120+
{
121+
id: 3,
122+
text: "",
123+
checkedColor: "#fcb779",
124+
uncheckedColor: "#ffd1a7",
125+
outerStyle: _outerStyle("#ffd1a7"),
126+
innerStyle: styles.innerStyle,
127+
},
128+
];
69129
```
70130

71131
## Example Project 😍
@@ -81,37 +141,19 @@ should work of the example project.
81141

82142
# Configuration - Props
83143

84-
## Fundamentals
85-
86-
| Property | Type | Default | Description |
87-
| ----------- | :----: | :-------: | --------------------- |
88-
| title | string | undefined | change the title |
89-
| description | string | undefined | change the descrition |
144+
You can use any customization on the `react-native-rounded-checkbox` component.
90145

91-
## Customization (Optionals)
92-
93-
| Property | Type | Default | Description |
94-
| -------------- | :-------: | :-------: | ---------------------------------------------------------------------- |
95-
| enableButton | boolean | false | let you enable the button (must use it for button) |
96-
| onPress | function | undefined | set your own logic for the button functionality when it is pressed |
97-
| buttonText | string | undefined | change the button's text |
98-
| style | ViewStyle | default | set or override the style object for the main container |
99-
| buttonStyle | ViewStyle | default | set or override the style object for the button style |
100-
| ImageComponent | Image | default | set your own component instead of default react-native Image component |
146+
[Configuration Options](https://github.com/WrathChaos/react-native-rounded-checkbox#readme)
101147

102148
## Future Plans
103149

104150
- [x] ~~LICENSE~~
105151
- [ ] Write an article about the lib on Medium
106152

107-
# Change Log
108-
109-
Change log will be here !
110-
111153
## Author
112154

113155
FreakyCoder, kurayogun@gmail.com
114156

115157
## License
116158

117-
React Native Typescript Library Starter is available under the MIT license. See the LICENSE file for more info.
159+
React Native Rounded Checkbox Group is available under the MIT license. See the LICENSE file for more info.

assets/logo.png

10.9 KB
Loading

example/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from "react";
2-
import { ViewStyle, SafeAreaView } from "react-native";
2+
import { ViewStyle, SafeAreaView, Image, Text, View } from "react-native";
33
import Icon from "react-native-dynamic-vector-icons";
44
import RoundedCheckboxGroup, {
55
ICheckboxButton,
6-
} from "./lib/RoundedCheckboxGroup";
6+
} from "./build/dist/RoundedCheckboxGroup";
77

88
const styles = {
99
innerStyle: { height: 45, width: 45, borderRadius: 75 },

example/lib/RoundedCheckboxGroup.style.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

example/lib/RoundedCheckboxGroup.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)