React Quill Examples: Master Rich Text Editing

Quill, a JavaScript rich text editor, seamlessly integrates with the ReactJS framework to provide robust and intuitive functionalities for developing impressive user interfaces. React-quill is an open-source library that brings the power of Quill to your React applications. In this article, we explore React-quill with practical examples to help you leverage its capabilities in your project.

10 REACT PROJECTS EVERY FRONTEND DEVELOPER SHOULD BUILD
10 REACT PROJECTS EVERY FRONTEND DEVELOPER SHOULD BUILD

Quill offers a superior text editing experience with features like complex styles, inline codes, and collaborative editing. Coupled with React, it becomes an indispensable tool for creating dynamic content. Let's dive into its core features and usage with simple examples.

React Native 2026 + AI
React Native 2026 + AI

Setting Up React-quill in Your Project

First, you need to install React-quill in your project. You can do this using npm or yarn:

a piece of paper with writing on it that says, react what is react?
a piece of paper with writing on it that says, react what is react?

```bash npm install react-quill # or yarn add react-quill ```

Basic React-quill Example

an image of a web page with the words react basics written in different font and numbers
an image of a web page with the words react basics written in different font and numbers

Once installed, you can start using React-quill in your components. Here's a basic example:

<import React, { useState } from 'react'>
<import { Quill } from 'react-quill'>
</import>

const App = () => {
  const [value, setValue] = useState('')

  const handleChange = (value) => {
    setValue(value)
  }

  return (
    <div>
      <Quill theme="snow" value={value} modules={modules} onChange={handleChange} />
    </div>
  )
}
</code>

Customizing Quill Modules and Formats

React projet setup
React projet setup

Quill offers various modules and formats for customizing its behavior. Here's an example of customizing `toolbar`, `formats`, and `modules`:

<import React, { useState } from 'react'>
<import { Quill } from 'react-quill'>
<import 'react-quill/dist/quill.snow.css'>
</import>

const modules = {
  toolbar: [
    [{ 'header': '1' }, { 'header': '2' }, { 'align': [] }],
    [{ size: [] }],
    ['bold', 'italic', 'underline', 'strike', 'blockquote'],
    [{ 'list': 'ordered' }, { 'list': 'bullet' }, { 'script': 'sub' }, { 'script': 'super' }],
    [{ 'indent': '-1' }, { 'indent': '+1' }],
  ],
  clipboard: {
    //ровomonas.toolbar.match(/.format/)
    matchVisual: false,
  },
}

const formats = [
  'header',
  'font',
  'size',
  'bold',
  'italic',
  'underline',
  'strike',
  'color',
  'background',
  'align',
  'list',
  'bullet',
  'indent',
]

const App = () => {
  const [value, setValue] = useState('')

  //...
}</code>

Advanced React-quill Examples

React Fundamental
React Fundamental

Now that you're familiar with the basics, let's explore some advanced usage, such as collaborative editing and integrating Quill with Redux.

Collaborative Editing with React-quill

Coding - React + Tailwind CSS Setup 🔥  #tailwindcss #css #react | Facebook
Coding - React + Tailwind CSS Setup 🔥 #tailwindcss #css #react | Facebook
The Ultimate React Hooks Cheat Sheet: 7 Hooks in One Visual Guide
The Ultimate React Hooks Cheat Sheet: 7 Hooks in One Visual Guide
the react component diagram is shown in this image
the react component diagram is shown in this image
20 REACT HOOKS EVERY DEVELOPER SHOULD KNOW
20 REACT HOOKS EVERY DEVELOPER SHOULD KNOW
20 React Projects Every Frontend Developer Should Build | Beginner to Advanced React Project Ideas
20 React Projects Every Frontend Developer Should Build | Beginner to Advanced React Project Ideas
25 REACT HOOKS EVERY DEVELOPER SHOULD KNOW
25 REACT HOOKS EVERY DEVELOPER SHOULD KNOW
react quill examples
react quill examples
Top 7 React Hooks Every Developer Should Know
Top 7 React Hooks Every Developer Should Know

For real-time collaborative editing, you can use a library like Yjs. Here's a brief example of how to get started:

<import { Quill } from 'react-quill'>
<import * as Y from 'yjs'>
<import { WebsocketProvider } from 'y-websocket'>

const provider = new WebsocketProvider('wss://your-websocket-server', 'demo-room')

const sharedQuillStore = new Y.QuillStore(provider)

const App = () => {
  //...
}</code>

Integrating React-quill with Redux

To manage Quill state in a Redux store, first, import the necessary actions and reducers:

<import { setQuillValue } from './actions'>
<import quillReducer from './reducers'>

Then, dispatch the appropriate action when the Quill value changes:

const handleChange = (value) => {
  dispatch(setQuillValue(value))
}</code>

React-quill offers immense potential for creating impressive user interfaces. It's easy to set up and integrate into your existing projects. By using the examples provided in this article, you can harness the power of Quill within your React applications.