Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/chrisnharvey/react-native-rte

Rich Text Editor for React Native (based on Quill.js)
https://github.com/chrisnharvey/react-native-rte

Last synced: about 4 hours ago
JSON representation

Rich Text Editor for React Native (based on Quill.js)

Awesome Lists containing this project

README

        

# React Native Rich Text Editor

A rich text editor for React Native based on Quill.js.

Compatible with iOS and Android.

## Installation

Install React Native Rich Text Editor using npm:

```
npm install react-native-rte --save
```

Link react-native-webview:

```
react-native link react-native-webview
```

## Example

```jsx
import React, { Component } from 'react';
import { SafeAreaView, KeyboardAvoidingView } from 'react-native';
import { RichText, Bold, Italic, OrderedList, UnorderedList, Link, Media } from 'react-native-rte'

export default class App extends Component {

addLink(editor) {
// Logic for opening a modal for URL entry here.....

editor.trigger('format', 'link', 'https://example.com')
}

selectMedia(editor) {
// Logic for opening an image selector here

editor.getSelection().then(function(payload) {
// Base64 Data
editor.trigger('insertEmbed', payload ? payload.index : 0, 'image', 'data:image/jpeg;base64,BASE64DATA')

// Or an image URL
editor.trigger('insertEmbed', payload ? payload.index : 0, 'image', 'http://example.com/image.jpg')
})
}

render() {
return (















)
}
}
```