react-native-button-master

1.0.2 • Public • Published

react-native-button-master

A button for React apps

Usage

Install the button from npm with npm install react-native-button-master --save. Then, require it from your app's JavaScript files with import Button from 'react-native-button-master'.

import React, { Component } from 'react';
import Button from 'react-native-button-master';

export default class ExampleComponent extends Component {
  constructor(props, context) {
    super(props, context);
  }
  _handlePress() {
    console.log('Pressed!');
  }
  render() {
    return (
      <Button
        style={{fontSize: 20, color: 'green'}}
        styleDisabled={{color: 'red'}}
        onPress={() => this._handlePress()}>
        Press Me!
      </Button>
    );
  }
};

The React packager will include the Button component in your app's JS package and make it available for your app to use.

Props

Prop Required Type Description
accessibilityLabel No String VoiceOver will read this string when a user selects the associated element.
allowFontScaling No Bool Specifies whether fonts should scale to respect Text Size accessibility settings.
Disabled No Bool Disables the button
Style No View Style Prop The style for the button
styleDisabled No View Style Prop The style for the disabled button
containerStyle No View Style Prop The style for the container
disabledContainerStyle No View Style Prop The style for the container when the button is disabled
childGroupStyle No View Style Prop The style for the child views
androidBackground No Background Prop Type The background for andriod devices.
onPress No Function Handler to be called when the user taps the button.

Contributing

Contributions are welcome. Please verify that styling matches the latest version of iOS when you are changing the visual look of the buttons.

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-button-master

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.66 kB

Total Files

5

Last publish

Collaborators

  • demopackage1