Skip to content

Latest commit

 

History

History

bpk-component-button-link

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

bpk-component-button-link

Backpack React Native button link component.

Default

Day Night
bpk-component-button-link default iPhone 8 simulator bpk-component-button-link default iPhone 8 simulator - dark mode
bpk-component-button-link default Google Pixel emulator bpk-component-button-link default Google Pixel emulator - dark mode

Installation

Check the main Readme for a complete installation guide.

Usage

import { View } from 'react-native';
import React, { Component } from 'react';
import BpkButtonLink from 'backpack-react-native/bpk-component-button-link';
import { spacingBase } from '@skyscanner/bpk-foundations-react-native/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}>
        <BpkButtonLink
          title="Book flight"
          onPress={() => {}} />
        <BpkButtonLink
          title="Disabled"
          disabled
          onPress={() => {}} />
        <BpkButtonLink
          large
          title="Book flight"
          onPress={() => {}} />
        <BpkButtonLink
          title="Book flight"
          icon="baggage"
          onPress={() => {}} />
        <BpkButtonLink
          title="Book flight"
          icon="baggage"
          iconAlignment="leading"
          onPress={() => {}} />
      </View>
    );
  }
}

Props

Property PropType Required Default Value
onPress func true -
title string true -
disabled bool false false
accessibilityLabel string false props.title
icon oneOf(string, element) Strings must be a BpkIcon false null
iconAlignment oneOf('leading', 'trailing') false trailing
large (iOS only) bool false false
borderlessBackground (Android only) bool false true
uppercase (Android only) bool false true
theme See Theme Props below false null
textProps object false null

Theme Props

  • buttonLinkTextColor