JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q44393F
  • License ISC

An animated switch button Written in TypeScript.

Package Exports

  • rn-switch-button
  • rn-switch-button/button-switch/button-switch.tsx

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rn-switch-button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

  • RN-Switch-Button is A dynamic Switch / toggle button that response to the touch with react native animation.

  • It comes with a built-in TypeScript typings and is compatible with all popular JavaScript frameworks. You can use it directly or leverage well-maintained wrapper packages that allow for a more native integration with your frameworks of choice.

Installation:

npm i rn-switch-button
yarn add rn-switch-button

Usage:

const HomeScreen = ({navigation, ...props}) => {

return (
<View contentContainerStyle={Styles.container}>


<ButtonSwitch
   deafultSelectedIndex={0}
   leftText="one"
   rightText="two"  />

</View>
);
};

export default HomeScreen;

Example:

Dataset Properties

Name Type
leftText string
rightText string
onClickLeft () => void
onClickRight () => void
outerViewStyle ViewStyle
innerViewStyle ViewStyle
buttonsStyle ViewStyle
activeButtonStyle ViewStyle
activeColor string
unActiveTextColor string
unActiveBackColor string
horizontalOffset number
textSelectedStyle TextStyle
textUnSelectedStyle TextStyle
deafultSelectedIndex number