Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/qeepsake/react-native-smart-text
- Owner: Qeepsake
- Created: 2019-08-18T12:07:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T07:12:27.000Z (over 2 years ago)
- Last Synced: 2025-01-06T20:39:46.795Z (about 1 month ago)
- Topics: component, emojis, markdown, nesting, react, react-native, text
- Language: JavaScript
- Homepage:
- Size: 551 KB
- Stars: 42
- Watchers: 2
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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