rn-button-component-helper

1.0.3 • Public • Published

rn-button-component-helper

A cross-platform (iOS, Android) button for React Native.

Features:

  • Cross-platform (iOS, Android)
  • Default styling works well
  • Extensively customisable styling and rendering
  • Many button type variations: small round, normal round, big round, small box, normal box, big box, etc.

Installation

Use Npm to install package: npm install rn-button-component-helper

Use Yarn to install package: yarn add rn-button-component-helper

Props

  • activeOpacity: Determines what the opacity of the wrapped view should be when touch is active. Defaults to 0.2.
  • type: The variants of button. Default to normal round
  • text: Text of button. Default to none
  • onPress: Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock).
  • accessibilityLabel: Overrides the text that's read by the screen reader when the user interacts with the element.
  • buttonStyle: Styling for custom button (TouchableOpacityProps).
  • textStyle: Styling for custom text (StyleProp).

Basic Usage

import RNButton from 'rn-button-component-helper';
 
<RNButton
    onPress={onPress}
    type={type}
    text={text}
    />

Custom Usage

import RNButton from 'rn-button-component-helper';
 
<RNButton
    accessibilityLabel={accessibilityLabel}
    onPress={onPress}
    activeOpacity={activeOpacity}
    type={type}
    buttonStyle={{buttonStyle}}
    textStyle={{textStyle}}
    >
 
    {children}
 
</RNButton>

License

MIT

Package Sidebar

Install

npm i rn-button-component-helper

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

9.26 kB

Total Files

4

Last publish

Collaborators

  • lims.id