1- <img alt =" React Native Typescript Library Starter " src =" assets/logo.png " width =" 1050 " />
1+ <img alt =" React Native Toggle Button " 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 Toggle Button ] ( 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-toggle-button )
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-toggle-button.svg?style=for-the-badge )] ( https://www.npmjs.com/package/react-native-toggle-button )
6+ [ ![ npm] ( https://img.shields.io/npm/dt/react-native-toggle-button.svg?style=for-the-badge )] ( https://www.npmjs.com/package/react-native-toggle-button )
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 Toggle Button "
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
4218Add the dependency:
4319
4420``` bash
45- npm i react-native-typescript-library-starter
21+ npm i react-native-toggle-button
4622```
4723
4824## Peer Dependencies
4925
50- <h5 ><i >IMPORTANT! You need install them</i ></h5 >
51-
52- ``` js
53- " react" : " >= 16.x.x" ,
54- " react-native" : " >= 0.55.x" ,
55- ```
26+ Zero Dependency
5627
5728# Usage
5829
5930## Import
6031
6132``` jsx
62- import MyComponent from " react-native-typescript-library-starter " ;
33+ import ToggleButton from " react-native-toggle-button " ;
6334```
6435
6536## Fundamental Usage
6637
6738``` jsx
68- < MyComponent / >
39+ < ToggleButton
40+ primaryText= " On"
41+ secondaryText= " Off"
42+ onPress= {(isToggled : boolean ) => {
43+ console .log (isToggled);
44+ }}
45+ / >
6946```
7047
7148## Example Project 😍
@@ -83,35 +60,33 @@ should work of the example project.
8360
8461## Fundamentals
8562
86- | Property | Type | Default | Description |
87- | ----------- | :----: | :-------: | --------------------- |
88- | title | string | undefined | change the title |
89- | description | string | undefined | change the descrition |
63+ | Property | Type | Default | Description |
64+ | ------------- | :------: | :-------: | ------------------------------------------------------------------ |
65+ | primaryText | string | undefined | change the primaryText |
66+ | secondaryText | string | undefined | change the secondaryText |
67+ | onPress | function | undefined | set your own logic for the button functionality when it is pressed |
9068
9169## Customization (Optionals)
9270
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 |
71+ | Property | Type | Default | Description |
72+ | ------------------- | :----------------------: | :-----: | ----------------------------------------------------------------------------------------- |
73+ | inial | boolean | true | let you change the initial toggled value |
74+ | style | ViewStyle | default | set or override the style object for the main container |
75+ | activeButtonStyle | ViewStyle | default | set or override the style object for the ` active button ` style |
76+ | inactiveButtonStyle | ViewStyle | default | set or override the style object for the ` inactive button ` style |
77+ | activeTextStyle | TextStyle | default | set or override the style object for the ` active text ` style |
78+ | inactiveTextStyle | TextStyle | default | set or override the style object for the ` inactive text ` style |
79+ | TouchableComponent | TouchableWithoutFeedback | default | set your own component instead of default react-native TouchableWithoutFeedback component |
10180
10281## Future Plans
10382
10483- [x] ~~ LICENSE~~
10584- [ ] Write an article about the lib on Medium
10685
107- # Change Log
108-
109- Change log will be here !
110-
11186## Author
11287
11388FreakyCoder, kurayogun@gmail.com
11489
11590## License
11691
117- React Native Typescript Library Starter is available under the MIT license. See the LICENSE file for more info.
92+ React Native Toggle Button is available under the MIT license. See the LICENSE file for more info.
0 commit comments