Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qeepsake/react-native-smart-text

Did someone give the React Native <Text /> component some spinach!? πŸ’ͺ supports emojis, markdown and nesting
https://github.com/qeepsake/react-native-smart-text

component emojis markdown nesting react react-native text

Last synced: 29 days ago
JSON representation

Did someone give the React Native <Text /> component some spinach!? πŸ’ͺ supports emojis, markdown and nesting

Awesome Lists containing this project

README

        

## Install

Install via npm:
```sh
npm install react-native-smart-text --save
```

## Usage

To use in React Native. Import:
```js
import { SmartText, LightText } from 'react-native-smart-text';
```

### Smart Text

The `` component contains a number of abilities:

1. Emoji πŸ˜„πŸ₯ΆπŸ€― it uses [node-emoji](https://www.npmjs.com/package/node-emoji) under the hood (e.g. 'I love it when you :grin:')
2. Markdown support for *italics* and **bold** (e.g. for \*italics\*, for \*\*bold\*\*)
3. Nested text support e.g. `My nested test!` where parent props will be inherited by children.

## Light Text

The `` componnet takes all the same props as `` but has no abilities! This component can be used
to enjoy all the benefits of easy styling and positioning without any of the extra code or processing which comes with ``.

- You can also nest `LightText` in a `SmartText`: `My nested test!`

## Props

| Prop | Type | Optional |
| ------------------- | ------------- | --------- |
| size | number | Yes |
| color | string | Yes |
| bold | boolean | Yes |
| italic | boolean | Yes |
| underline | boolean | Yes |
| strikethrough | boolean | Yes |
| align | string | Yes |
| lineHeight | number | Yes |
| family | string | Yes |
| opacity | number | Yes |
| style | object | Yes |
| m, mh, mv, ml, mr, mt, mb | number | Yes |
| p, ph, pv, pl, pr, pt, pb | number | Yes |

## Authors

* [**Luke Brandon Farrell**](https://lukebrandonfarrell.com/) - *Author*

## License

This project is licensed under the MIT License