1.1.1 • Published 6 years ago

react-native-text-with v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-native-text-with

npm npm licence npm downloads

Extension of the <Text/> component to allow easy placement of an object, image or icon beside text in React Native

To the left To the right At the top At the bottom No object

Install

To get started install via npm:

 npm install react-native-text-with --save

Usage

To use in React Native. Import:

 import TextWith from 'react-native-text-with';

Then add it to your code:

<TextWith
  object={<Image source={}/>}
  objectPosition='left'
  objectMargin={5}>
  This is some text with an image to the left
</TextWith>

Works as a normal react component. All probs available from <Text/>.

<TextWith numberOfLines={1} onPress={console.log('This is a ordinary text component')}>
  This is some text
</TextWith>

Works well with react-native-vector-icons. But it's not a dependency! nor a necessity.

<TextWith
  object={<Icon name='pencil' size={ 18 }/>}
  objectPosition='left'
  objectMargin={20}>
  This is some text
</TextWith>

Props

Note: The component can take all props available to <Text/>

PropTypeOptionalDefaultDescription
childrenAnyYesPass anything into text <TextWith> I am text! </TextWith>
objectobjectYesImage, Icon or component of your choice to be rendered beside text
objectPositionenumYes'left'Where the component should be rendered ('left', 'right', 'top', 'bottom')
objectMarginnumberYes4Direction of the collage: 'row' or 'column'.
textStyleobjectYesStyle to be applied to the text component
containerStyleobjectYesalignItems: 'center'Style to be applied to the container component. Text and Icon.

Contributing

If you want to issue a PR, go ahead ;)

Authors

License

This project is licensed under the MIT License

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago