npm

Need private packages and team management tools?Check out npm Orgs. »

react-native-bpk-component-text

4.2.1 • Public • Published

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, { WEIGHT_STYLES } from 'react-native-bpk-component-text';
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}>
        <BpkText textStyle='xxl'>Backpack rocks!</BpkText>
        <BpkText textStyle='xl' weight={WEIGHT_STYLES.heavy}>Backpack rocks!</BpkText>
        <BpkText textStyle='lg' weight={WEIGHT_STYLES.emphasized}>Backpack rocks!</BpkText>
        <BpkText textStyle='base'>Backpack rocks!</BpkText>
        <BpkText textStyle='sm'>Backpack rocks!</BpkText>
        <BpkText textStyle='xs'>Backpack rocks!</BpkText>
        <BpkText textStyle='caps'>BACKPACK ROCKS!</BpkText>
      </View>
    );
  }
}

Props

Property PropType Required Default Value
children node true -
textStyle oneOf('xxl', 'xl', 'lg', 'base', 'sm', 'xs', 'caps') false base
weight oneOf('regular', 'emphasized', 'heavy') false regular
emphasize (deprecated, use weight) bool false false

Theme props

  • textFontFamily

NOTE: For Android we expect font names to follow a specific name convention for bold and heavy variations. E.g. if you provide a font called myFont to the textFontFamilytheme attribute, we expect two more fonts to be available, those are myFont_bold and myFont_black.

Keywords

none

install

npm i react-native-bpk-component-text

Downloadsweekly downloads

380

version

4.2.1

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability