New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-bpk-component-button

Package Overview
Dependencies
Maintainers
5
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-bpk-component-button

Backpack React Native button component.

latest
Source
npmnpm
Version
12.0.1
Version published
Weekly downloads
32
190.91%
Maintainers
5
Weekly downloads
 
Created
Source

react-native-bpk-component-button

Backpack React Native button component.

Installation

  • Install the npm package:
npm install react-native-bpk-component-button --save-dev
  • Add some dependencies to your Podfile (iOS Only):
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => '../node_modules/react-native'
pod 'BVLinearGradient', :path => '../node_modules/react-native-bpk-component-button/node_modules/react-native-linear-gradient'
  • react-native-bpk-component-button depends on react-native-bpk-component-icon make sure to follow the installation guide for the icon component for the different platforms

Note: This is necessary because react-native-bpk-component-button depends on react-native-linear-gradient.

Usage

import { StyleSheet, View } from 'react-native';
import React, { Component } from 'react';
import BpkButton, { BUTTON_TYPES, ICON_ALIGNMENTS } from 'react-native-bpk-component-button';
import { spacingBase } from 'bpk-tokens/tokens/base.react.native';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: spacingBase,
  }
});

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <BpkButton
          type={BUTTON_TYPES.primary}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButton
          type={BUTTON_TYPES.featured}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButton
          disabled
          type={BUTTON_TYPES.destructive}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButton
          large
          type={BUTTON_TYPES.primary}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButton
          type={BUTTON_TYPES.featured}
          title="Book flight"
          icon="baggage"
          onPress={() => {}}
        />
        <BpkButton
          type={BUTTON_TYPES.primary}
          title="Book flight"
          icon="baggage"
          iconAlignment={ICON_ALIGNMENTS.leading}
          onPress={() => {}}
        />
        <BpkButton
          type={BUTTON_TYPES.featured}
          title="Book flight"
          icon="baggage"
          iconOnly
          onPress={() => {}}
        />
      </View>
    );
  }
}

Props

PropertyPropTypeRequiredDefault Value
onPressfunctrue-
titlestringtrue-
accessibilityLabelstringfalseprops.title
disabledboolfalsefalse
icononeOf(string, element) Strings must be a BpkIconfalsenull
iconAlignmentoneOf('leading', 'trailing')falsetrailing
iconOnly (iOS only)boolfalsefalse
large (iOS only)boolfalsefalse
themeSee Theme Props belowfalsenull
typeoneOf('primary', 'featured', 'secondary', 'destructive', 'outline')falsenull

Theme Props

Primary

  • buttonPrimaryTextColor
  • buttonPrimaryGradientStartColor
  • buttonPrimaryGradientEndColor

Secondary

  • buttonSecondaryTextColor
  • buttonSecondaryBackgroundColor
  • buttonSecondaryBorderColor
  • buttonFeaturedTextColor
  • buttonFeaturedGradientStartColor
  • buttonFeaturedGradientEndColor

Destructive

  • buttonDestructiveTextColor
  • buttonDestructiveBackgroundColor
  • buttonDestructiveBorderColor

FAQs

Package last updated on 26 Feb 2020

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