0.0.1 • Published 5 years ago

react-native-text-switch v0.0.1

Weekly downloads
3
License
Apache License 2....
Repository
github
Last release
5 years ago
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
PropTypeDefaultNote
backgroundColorstring #HEX-COLOR#DE6840Specify background color
selectionBackgroundColorstring #HEX-COLOR#FFFFFFSpecify selected background color
titleColorstring #HEX-COLOR#FFFFFFSpecify title color
selectedTitleColorstring #HEX-COLOR#DE6840Specify selected title color
leftTitlestringYESSpecify left title
rightTitlestringNOSpecify right title
selectedIndexnumberSpecify selected index
onChangefuncSpecify 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.

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