Convert Figma logo to code with AI

slab logoquill

Quill is a modern WYSIWYG editor built for compatibility and extensibility

43,087
3,349
43,087
387

Top Related Projects

22,569

A React framework for building text editors.

43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.

The ProseMirror WYSIWYM editor

29,602

A completely customizable framework for building rich text editors. (Currently in beta.)

Quick Overview

Quill is a modern, powerful rich text editor built for compatibility and extensibility. It's designed to be easy to use and customize, making it suitable for a wide range of applications from simple text inputs to complex document editors.

Pros

  • Highly customizable and extensible through modules and themes
  • Cross-platform compatibility and consistent behavior across browsers
  • Clean and intuitive API for easy integration
  • Active development and community support

Cons

  • Steeper learning curve compared to simpler WYSIWYG editors
  • Large file size may impact page load times for smaller projects
  • Some advanced features require additional configuration or custom modules
  • Limited built-in table support (requires additional module)

Code Examples

  1. Basic initialization:
const quill = new Quill('#editor', {
  theme: 'snow'
});

This code initializes a Quill editor with the default Snow theme on an element with the ID 'editor'.

  1. Adding custom formats:
const quill = new Quill('#editor', {
  modules: {
    toolbar: [
      ['bold', 'italic', 'underline'],
      ['link', 'image'],
      [{ 'color': [] }, { 'background': [] }]
    ]
  }
});

This example creates a Quill editor with a custom toolbar containing bold, italic, underline, link, image, text color, and background color options.

  1. Handling content changes:
quill.on('text-change', function(delta, oldDelta, source) {
  if (source == 'user') {
    console.log('A user action triggered this change.');
  }
});

This code adds an event listener to detect changes in the editor content, logging a message when the change is triggered by a user action.

Getting Started

To get started with Quill, follow these steps:

  1. Include Quill in your project:
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
  1. Create a container for the editor:
<div id="editor"></div>
  1. Initialize Quill:
const quill = new Quill('#editor', {
  theme: 'snow',
  modules: {
    toolbar: [
      ['bold', 'italic', 'underline'],
      ['link', 'image'],
      [{ 'header': [1, 2, 3, false] }]
    ]
  }
});

This will create a basic Quill editor with a toolbar containing formatting options, link and image insertion, and header styles.

Competitor Comparisons

22,569

A React framework for building text editors.

Pros of Draft.js

  • More flexible and customizable architecture
  • Better support for complex text editing features
  • Stronger TypeScript support

Cons of Draft.js

  • Steeper learning curve
  • Less out-of-the-box functionality
  • Requires more setup and configuration

Code Comparison

Draft.js:

import {Editor, EditorState} from 'draft-js';

const [editorState, setEditorState] = useState(EditorState.createEmpty());

<Editor editorState={editorState} onChange={setEditorState} />

Quill:

import Quill from 'quill';

const quill = new Quill('#editor', {
  theme: 'snow'
});

Draft.js provides a more granular control over the editor's content and behavior, while Quill offers a simpler API with more built-in features. Draft.js uses a immutable data model, which can be beneficial for complex applications but may require more boilerplate code. Quill, on the other hand, provides a more straightforward approach to rich text editing with less setup required.

Both libraries have active communities and are widely used in production environments. The choice between them often depends on the specific requirements of the project and the development team's preferences.

43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Pros of Quill

  • More actively maintained with recent updates
  • Larger community and contributor base
  • Better documentation and examples

Cons of Quill

  • Potentially more complex due to additional features
  • May have a steeper learning curve for beginners
  • Larger file size and potentially higher resource usage

Code Comparison

Quill:

var quill = new Quill('#editor', {
  theme: 'snow',
  modules: {
    toolbar: [['bold', 'italic'], ['link', 'image']]
  }
});

Quill>:

var quill = new Quill('#editor', {
  theme: 'bubble',
  placeholder: 'Compose an epic...'
});

Both repositories appear to be the same project, with Quill> likely being a fork or alternative version of Quill. The main differences seem to be in the default configuration and potentially some feature variations. Quill offers more customization options out of the box, while Quill> may focus on simplicity and ease of use. Without more specific information about Quill>, it's challenging to provide a more detailed comparison. Users should carefully evaluate both options based on their specific needs and project requirements.

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

Pros of TinyMCE

  • More extensive feature set, including advanced table editing and image manipulation
  • Longer development history, resulting in a more mature and stable codebase
  • Larger ecosystem with numerous plugins and integrations available

Cons of TinyMCE

  • Larger file size and potentially slower load times compared to Quill
  • Steeper learning curve for developers due to its complexity
  • Less modern API design, which may be less intuitive for some developers

Code Comparison

TinyMCE initialization:

tinymce.init({
  selector: '#editor',
  plugins: 'link image table',
  toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | link image'
});

Quill initialization:

var quill = new Quill('#editor', {
  modules: {
    toolbar: [
      ['bold', 'italic', 'underline'],
      ['link', 'image']
    ]
  },
  theme: 'snow'
});

Both editors offer customizable toolbars and modules, but TinyMCE's configuration tends to be more verbose and detailed, while Quill's is more concise and straightforward. TinyMCE provides more built-in features out of the box, whereas Quill focuses on a leaner core with extensibility through modules.

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.

Pros of CKEditor 5

  • More extensive plugin ecosystem and customization options
  • Better support for complex document structures and layouts
  • Stronger focus on accessibility and compliance with standards

Cons of CKEditor 5

  • Steeper learning curve and more complex configuration
  • Larger file size and potentially higher performance overhead
  • Less suitable for simple, lightweight editing tasks

Code Comparison

Quill initialization:

var quill = new Quill('#editor', {
  theme: 'snow'
});

CKEditor 5 initialization:

ClassicEditor
  .create(document.querySelector('#editor'))
  .then(editor => {
    console.log('Editor was initialized', editor);
  })
  .catch(error => {
    console.error(error);
  });

Both Quill and CKEditor 5 are powerful rich text editors, but they cater to different use cases. Quill is more lightweight and easier to set up, making it ideal for simpler editing tasks. CKEditor 5, on the other hand, offers more advanced features and customization options, making it suitable for complex document editing scenarios. The choice between the two depends on the specific requirements of your project, considering factors such as desired features, performance needs, and development complexity.

The ProseMirror WYSIWYM editor

Pros of ProseMirror

  • More flexible and customizable architecture
  • Better support for collaborative editing
  • Stronger focus on document structure and semantics

Cons of ProseMirror

  • Steeper learning curve
  • Less out-of-the-box functionality
  • Requires more setup and configuration

Code Comparison

ProseMirror:

import {Schema} from "prosemirror-model"
import {EditorState} from "prosemirror-state"
import {EditorView} from "prosemirror-view"

const schema = new Schema({
  nodes: {
    doc: {content: "block+"},
    paragraph: {group: "block", content: "inline*"},
    text: {group: "inline"}
  }
})

Quill:

var quill = new Quill('#editor', {
  modules: {
    toolbar: [
      ['bold', 'italic'],
      ['link', 'image']
    ]
  },
  theme: 'snow'
});

ProseMirror offers more granular control over the document structure and editing behavior, while Quill provides a simpler API with more built-in features. ProseMirror's approach allows for greater customization but requires more setup, whereas Quill is easier to get started with but may be less flexible for complex use cases.

29,602

A completely customizable framework for building rich text editors. (Currently in beta.)

Pros of Slate

  • More flexible and customizable architecture
  • Better support for complex, nested document structures
  • Easier to extend with plugins and custom behaviors

Cons of Slate

  • Steeper learning curve due to its lower-level API
  • Less out-of-the-box functionality compared to Quill
  • Smaller community and ecosystem

Code Comparison

Slate example:

import { Editor } from 'slate-react'

const MyEditor = () => (
  <Editor
    value={initialValue}
    onChange={value => setValue(value)}
    renderBlock={props => /* Custom block rendering */}
  />
)

Quill example:

var quill = new Quill('#editor', {
  modules: {
    toolbar: [['bold', 'italic'], ['link', 'image']]
  },
  theme: 'snow'
});

Key Differences

  • Slate uses a tree-based document model, while Quill uses a flat structure
  • Slate offers more granular control over editing behavior
  • Quill provides a more opinionated and ready-to-use solution
  • Slate is React-focused, while Quill is framework-agnostic

Use Cases

  • Choose Slate for highly customized editing experiences or complex document structures
  • Opt for Quill when rapid development and out-of-the-box functionality are priorities

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Quill Rich Text Editor

Quill Logo

DocumentationDevelopmentContributingInteractive Playground

Build Status Version Downloads


Quill is a modern rich text editor built for compatibility and extensibility. It was created by Jason Chen and Byron Milligan and actively maintained by Slab.

To get started, check out https://quilljs.com/ for documentation, guides, and live demos!

Quickstart

Instantiate a new Quill object with a css selector for the div that should become the editor.

<!-- Include Quill stylesheet -->
<link
  href="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.snow.css"
  rel="stylesheet"
/>

<!-- Create the toolbar container -->
<div id="toolbar">
  <button class="ql-bold">Bold</button>
  <button class="ql-italic">Italic</button>
</div>

<!-- Create the editor container -->
<div id="editor">
  <p>Hello World!</p>
  <p>Some initial <strong>bold</strong> text</p>
  <p><br /></p>
</div>

<!-- Include the Quill library -->
<script src="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.js"></script>

<!-- Initialize Quill editor -->
<script>
  const quill = new Quill("#editor", {
    theme: "snow",
  });
</script>

Take a look at the Quill website for more documentation, guides and live playground!

Download

npm install quill

CDN

<!-- Main Quill library -->
<script src="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.js"></script>

<!-- Theme included stylesheets -->
<link
  href="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.snow.css"
  rel="stylesheet"
/>
<link
  href="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.bubble.css"
  rel="stylesheet"
/>

<!-- Core build with no theme, formatting, non-essential modules -->
<link
  href="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.core.css"
  rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.core.js"></script>

Community

Get help or stay up to date.

License

BSD 3-clause

NPM DownloadsLast 30 Days