Socket
Socket
Sign inDemoInstall

react-native-material-buttons

Package Overview
Dependencies
516
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-material-buttons

Material buttons


Version published
Weekly downloads
50K
increased by15.3%
Maintainers
1
Install size
180 kB
Created
Weekly downloads
 

Readme

Source

react-native-material-buttons

npm license

Material buttons with consistent behaviour on iOS and Android

example

Features

  • Easy to use
  • Consistent look and feel on iOS and Android
  • Animated state transitions
  • Ripple animation on touch
  • Pure javascript implementation

Installation

npm install --save react-native-material-buttons

Usage

import React, { Component } from 'react';
import { TextButton, RaisedTextButton } from 'react-native-material-buttons';

class Example extends Component {
  _onPress = ({ id }) => {
    console.log(`${id} pressed`);
  };

  render() {
    let payload = { id: 'button-1' };

    return (
      <RaisedTextButton title='touch me' onPress={this._onPress} payload={payload} />
    );
  }
}

Common properties

namedescriptiontypedefault
colorButton colorStringrgb(224, 224, 224)
disabledColorButton color for disabled stateStringrgb(240, 240, 240)
shadeColorButton shade color for focused stateStringrgb(0, 0, 0)
shadeOpacityButton shade opacity for focused stateNumber0.12
shadeBorderRadiusButton shade border radiusNumber2
focusAnimationFocus animation stateAnimated.Value-
disableAnimationDisable animation stateAnimated.Value-
focusAnimationDurationFocus animation duration in msNumber225
disableAnimationDurationDisable animation duration in msNumber225
disabledButton availabilityBooleanfalse
onPressTouch up callbackFunction-
payloadPayload object for onPress callbackAny-

Other Ripple properties will also work

TextButton properties

namedescriptiontypedefault
titleButton titleString-
titleColorButton title colorStringrgb(0, 0, 0)
disabledTitleColorButton title color for disabled stateStringrgba(0, 0, 0, .26)
titleStyleButton title styleObject-

RaisedTextButton properties

namedescriptiontypedefault
titleButton titleString-
titleColorButton title colorStringrgb(66, 66, 66)
disabledTitleColorButton title color for disabled stateStringrgba(0, 0, 0, .26)
titleStyleButton title styleObject-

Example

git clone https://github.com/n4kz/react-native-material-buttons
cd react-native-material-buttons/example
npm install
npm run ios # or npm run android

BSD License

Copyright 2017-2019 Alexander Nazarov. All rights reserved.

Keywords

FAQs

Last updated on 01 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc