Link

This component enables links to other resources, pages or views.

bpk-component-text-link

Backpack React Native text link component.

Default

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

Installation

Check the main Readme for a complete installation guide.

Usage


                                                
                                                import React from 'react';
                                                import { StyleSheet, View } from 'react-native';
                                                import { spacingBase } from '@skyscanner/bpk-foundations-react-native/tokens/base.react.native';
                                                import BpkTextLink from 'backpack-react-native/bpk-component-text-link';
                                                
                                                const styles = StyleSheet.create({
                                                  container: {
                                                    flex: 1,
                                                    justifyContent: 'center',
                                                    padding: spacingBase,
                                                  }
                                                });
                                                
                                                export default () => (
                                                  <View style={styles.container}>
                                                    <BpkText>
                                                        Check out the <BpkTextLink accessibilityLabel="link to website" onPress={() => {}}>website</BpkTextLink>
                                                      </BpkText>
                                                  </View>
                                                );

Props

This component creates a pressable instance of the BpkText component and accepts the same props as BpkText, alongside the following:

Property PropType Required Default Value
accessibilityLabel string true null
children node true -
onPress func true -
theme See Theme Props below false null

Theme Props

  • linkTextColor