Skip to content

Latest commit

 

History

History
 
 

react-native-bpk-component-text

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

react-native-bpk-component-text

Backpack React Native text component.

Installation

npm install react-native-bpk-component-text --save-dev

Usage

import React, { Component } from 'react';
import { View, StyleSheet } from 'react-native';
import BpkText from 'react-native-bpk-component-text';
import * as TOKENS from 'bpk-tokens/tokens/ios/base.react.native.es6';

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

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <BpkText textStyle='xxl'>Flights to Edinburgh</BpkText>
        <BpkText textStyle='xl'>Flights to Edinburgh</BpkText>
        <BpkText textStyle='lg'>Flights to Edinburgh</BpkText>
        <BpkText textStyle='base'>Flights to Edinburgh</BpkText>
        <BpkText textStyle='sm'>Flights to Edinburgh</BpkText>
        <BpkText textStyle='xs'>Flights to Edinburgh</BpkText>
      </View>
    );
  }
}

Props

Property PropType Required Default Value
children node true -
textStyle oneOf('xxl', 'xl', 'lg', 'base', 'sm', 'xs') false 'base'
emphasize bool false false