Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-material-buttons

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-material-buttons

Material buttons

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 01 Oct 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc