You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-quill-editors

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-quill-editors

A fully customizable React rich text editor with no external dependencies. Features a comprehensive toolbar similar to popular Markdown editors with file operations, media insertion, and advanced formatting capabilities.

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
350
Maintainers
0
Weekly downloads
 
Created
Source

React Quill Editors

A fully customizable React rich text editor with no external dependencies. Built from scratch using only React and native browser APIs. Features a comprehensive toolbar similar to popular Markdown editors with file operations, media insertion, and advanced formatting capabilities.

✨ Features

  • No external dependencies - Built entirely with React and native browser APIs
  • Markdown editor-style interface - Comprehensive toolbar with file operations, formatting, and media tools
  • Fully customizable - Enable/disable features via props
  • Modern UI - Clean, responsive design with professional styling
  • TypeScript support - Full TypeScript definitions included
  • Accessible - Keyboard navigation and screen reader support
  • Lightweight - Minimal bundle size
  • File operations - Save, delete, close functionality
  • Media support - Insert links, images, videos, and attachments
  • Advanced formatting - Headings, code blocks, quotes, horizontal rules
  • Color controls - Text and background color options
  • Font controls - Size and family selection
  • Alignment tools - Left, center, right, justify alignment
  • List support - Bullet and numbered lists
  • Preview mode - Real-time content preview

🚀 Installation

npm install react-quill-editors

📖 Quick Start

import { RichTextEditor } from 'react-quill-editors';

function App() {
  const [content, setContent] = useState('');

  return (
    <RichTextEditor
      features={{
        // File operations
        save: true,
        delete: true,
        close: true,
        
        // Text formatting
        heading: true,
        bold: true,
        italic: true,
        underline: true,
        strikethrough: true,
        
        // Font controls
        fontSize: true,
        fontFamily: true,
        
        // Colors
        color: true,
        bgColor: true,
        
        // Alignment
        align: true,
        
        // Lists
        lists: true,
        
        // Media
        link: true,
        image: true,
        video: true,
        
        // Special formatting
        code: true,
        quote: true,
        horizontalRule: true,
        
        // Additional features
        attachment: true,
        preview: true,
      }}
      value={content}
      onChange={setContent}
      onSave={() => console.log('Saving...')}
      onDelete={() => console.log('Deleting...')}
      onClose={() => console.log('Closing...')}
      onPreview={() => console.log('Preview...')}
      placeholder="Start typing..."
    />
  );
}

📚 API Reference

RichTextEditor Props

PropTypeDefaultDescription
featuresEditorFeatures{}Object to enable/disable specific features
valuestring''The HTML content of the editor
onChange(value: string) => void-Callback when content changes
placeholderstring'Start typing...'Placeholder text when editor is empty
classNamestring''Additional CSS class name
styleReact.CSSProperties{}Inline styles for the editor
readOnlybooleanfalseMakes the editor read-only
disabledbooleanfalseDisables the editor completely
onSave() => void-Callback for save button
onDelete() => void-Callback for delete button
onClose() => void-Callback for close button
onPreview() => void-Callback for preview button

EditorFeatures

CategoryFeaturePropDescription
File Operations
Savesave: trueSave button with callback
Deletedelete: trueDelete button with callback
Closeclose: trueClose button with callback
Text Formatting
Headingheading: trueInsert headings (H1-H6)
Boldbold: trueToggle bold text
Italicitalic: trueToggle italic text
Underlineunderline: trueToggle underlined text
Strikethroughstrikethrough: trueToggle strikethrough text
Font Controls
Font SizefontSize: trueChange text size (8px-36px)
Font FamilyfontFamily: trueChange font family
Colors
Text Colorcolor: trueChange text color
Background ColorbgColor: trueChange background color
Alignment
Alignmentalign: trueText alignment (left, center, right, justify)
Lists
Listslists: trueBullet and numbered lists
Media
Linklink: trueInsert links
Imageimage: trueInsert images
Videovideo: trueInsert videos
Special Formatting
Codecode: trueInsert code blocks
Quotequote: trueInsert blockquotes
Horizontal RulehorizontalRule: trueInsert horizontal rules
Additional Features
Attachmentattachment: trueFile attachment functionality
Previewpreview: truePreview mode with callback

💡 Usage Examples

Basic Editor

import { RichTextEditor } from 'react-quill-editors';

function BasicEditor() {
  const [content, setContent] = useState('');

  return (
    <RichTextEditor
      features={{
        bold: true,
        italic: true,
        underline: true,
      }}
      value={content}
      onChange={setContent}
    />
  );
}

Markdown-Style Editor

import { RichTextEditor } from 'react-quill-editors';

function MarkdownStyleEditor() {
  const [content, setContent] = useState('');

  const handleSave = () => {
    console.log('Saving content:', content);
  };

  const handleDelete = () => {
    if (confirm('Are you sure?')) {
      setContent('');
    }
  };

  return (
    <RichTextEditor
      features={{
        // File operations
        save: true,
        delete: true,
        close: true,
        
        // Text formatting
        heading: true,
        bold: true,
        italic: true,
        underline: true,
        strikethrough: true,
        
        // Font controls
        fontSize: true,
        fontFamily: true,
        
        // Colors
        color: true,
        bgColor: true,
        
        // Alignment
        align: true,
        
        // Lists
        lists: true,
        
        // Media
        link: true,
        image: true,
        video: true,
        
        // Special formatting
        code: true,
        quote: true,
        horizontalRule: true,
        
        // Additional features
        attachment: true,
        preview: true,
      }}
      value={content}
      onChange={setContent}
      onSave={handleSave}
      onDelete={handleDelete}
      placeholder="Start typing your content..."
    />
  );
}

Read-Only Editor

import { RichTextEditor } from 'react-quill-editors';

function ReadOnlyEditor() {
  const content = '<p><strong>This is read-only content</strong> with <em>various formatting</em>.</p>';

  return (
    <RichTextEditor
      features={{
        bold: true,
        italic: true,
        underline: true,
        fontSize: true,
        fontFamily: true,
        color: true,
        align: true,
      }}
      value={content}
      readOnly={true}
    />
  );
}

Custom Styled Editor

import { RichTextEditor } from 'react-quill-editors';

function CustomStyledEditor() {
  const [content, setContent] = useState('');

  return (
    <RichTextEditor
      features={{
        bold: true,
        italic: true,
        color: true,
        align: true,
        lists: true,
      }}
      value={content}
      onChange={setContent}
      className="custom-editor"
      style={{
        border: '2px solid #007bff',
        borderRadius: '8px',
        minHeight: '400px',
        boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
      }}
    />
  );
}

🎨 Available Options

Font Sizes

  • 8px, 10px, 12px, 14px, 18px, 24px, 36px

Font Families

  • Arial, Times New Roman, Courier New, Georgia, Verdana, Helvetica

Color Palette

The editor includes a comprehensive color palette with 15 predefined colors:

  • Basic: Black, White
  • Primary: Red, Green, Blue
  • Secondary: Yellow, Magenta, Cyan
  • Extended: Gray, Maroon, Olive, Purple, Teal, Navy

🌐 Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

🛠️ Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Clean build directory
npm run clean

🤝 Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Akshay Bhalala

🙏 Acknowledgments

  • Built with React and TypeScript
  • Uses native browser document.execCommand() API
  • Inspired by modern Markdown editors and rich text editors
  • Special thanks to the React community for inspiration and best practices

📦 Keywords

  • react
  • text-editor
  • rich-text
  • wysiwyg
  • editor
  • typescript
  • markdown
  • content-editor
  • html-editor
  • formatting
  • toolbar
  • no-dependencies
  • lightweight
  • customizable
  • accessible
  • modern-ui
  • file-operations
  • media-insertion
  • color-picker
  • font-controls
  • alignment-tools
  • list-support
  • preview-mode

Keywords

react

FAQs

Package last updated on 30 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts