Contents
Description:
A highly customizable text editor for React with customizable layout, based on Draft.js. arch-editor is lightweight in the size and easy to use.
How to install and use it?
1. Install the component with NPM.
npm install arch-editor –save
2. Import the required components.
import React from ‘react’;
import ReactDOM from ‘react-dom’;
import ‘arch-editor/dist/arch-editor.css’;
import { ArchEditor, BlockToolbar, ArchEditorProvider } from ‘arch-editor’;
3. Now, add the text editor in your page.
function App() {
return (
<ArchEditorProvider>
<BlockToolbar />
<ArchEditor placeholder=”Please enter text.” showInlineToolbar />
</ArchEditorProvider>;
);
}
ReactDOM.render(<App />,document.getElementById(‘root’));
The post A simple and customizable text editor for React – arch-editor appeared first on Lipku.com.