GithubHelp home page GithubHelp logo

miguelramosfdz / react-native-button Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apsl/react-native-button

0.0 1.0 0.0 28 KB

A React Native button component customizable via props

License: MIT License

JavaScript 53.05% Objective-C 46.95%

react-native-button's Introduction

apsl-react-native-button

A React Native button component customizable via style props.

Button component screenshot

Install

Install the package:

$ npm i apsl-react-native-button --save

Import the Button component:

import Button from 'apsl-react-native-button'

Usage

Provide TouchableOpacity' props to the component (including style), textStyle's StyleSheet to customize the inner text and a children node to render. You can also provide the isLoading prop that will dim the button and disable it to prevent accidental taps.

<Button style={{backgroundColor: 'red'}} textStyle={{fontSize: 18}}>
  Hello!
</Button>

API

Prop Type Description
onPress func Function to execute when the onPress event is triggered.
onPressIn func Function to execute when the onPressIn event is triggered.
onPressOut func Function to execute when the onPressOut event is triggered.
onLongPress func Function to execute when the onLongPress event is triggered.
textStyle TextStylePropTypes The StyleSheet to apply to the inner button text.
children string The string to render as the text button.
isLoading bool Renders an inactive state dimmed button with a spinner if true.
isDisabled bool Renders an inactive state dimmed button if true.
activityIndicatorColor string iOS only. Sets the button of the ActivityIndicatorIOS in the loading state.

Check the included example for more options.

License

MIT.

react-native-button's People

Contributors

alvaromb avatar faridsafi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.