react-native-text-switch

0.0.1 • Public • Published

PRs Welcome

ReactNative: Native Text Switch (Android/iOS)

If this project has helped you out, please support us with a star 🌟

This library is a React Native bridge around native text switch libraries. It allows show/guide beautiful text switch:

iOS: rcgary/RCRunkeeperSwitch
Android: polyak01/IconSwitch

📖 Getting started

$ npm install react-native-text-switch --save

$ react-native link react-native-text-switch

  • Android

Please add below snippet into your app build.gradle


buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
    ...
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "https://maven.google.com" }
        ...
    }
}

dependencies {

}

Note: This library is supported Android SDK 28 > above

  • iOS
    • After react-native link react-native-text-switch, please verify node_modules/react-native-text-switch/ios/ contains Pods folder. If does not exist please execute pod install command on node_modules/react-native-text-switch/ios/, if any error => try pod repo update then pod install

    • Now build your iOS app through Xcode

💻 Usage

import { RNTextSwitch } from 'react-native-text-switch';
 
 
<RNTextSwitch />
 

💡 Props

  • Props: Generic
Prop Type Default Note
backgroundColor string #HEX-COLOR #DE6840 Specify background color
selectionBackgroundColor string #HEX-COLOR #FFFFFF Specify selected background color
titleColor string #HEX-COLOR #FFFFFF Specify title color
selectedTitleColor string #HEX-COLOR #DE6840 Specify selected title color
leftTitle string YES Specify left title
rightTitle string NO Specify right title
selectedIndex number Specify selected index
onChange func Specify color of highlighted text color

✨ Credits

🤔 How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list below. ✨

📜 License

This library is provided under the Apache License.

RNTextSwitch @ prscX

💖 Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like 🚀

  • If you're feeling especially charitable, please follow prscX on GitHub.

    Buy Me A Coffee

    Thanks! ❤️
    prscX.github.io
    </ Pranav >

Readme

Keywords

Package Sidebar

Install

npm i react-native-text-switch

Weekly Downloads

0

Version

0.0.1

License

Apache License 2.0

Unpacked Size

39.2 kB

Total Files

14

Last publish

Collaborators

  • pranavchauhan01