Skip to content

AkincanD/react-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

React Editor

A powerful, extensible, and beautiful rich text editor for React with TypeScript support.

npm version License: MIT

✨ Features

  • 🎨 Beautiful UI - Modern, clean interface with light and dark themes
  • πŸ”Œ Extensible Plugin System - Easy to create and integrate custom plugins
  • πŸ“± Fully Responsive - Works seamlessly on all screen sizes
  • 🎯 TypeScript Support - Full type definitions included
  • βš›οΈ React 18+ Compatible - Built for modern React applications
  • πŸŒ™ Dark Mode - Built-in theme switching support
  • πŸ’… Pure CSS - No external CSS framework required (33% smaller bundle)
  • πŸ”— Link Insertion - Beautiful modal interface for adding links
  • πŸŽ₯ Video Embedding - Easy YouTube & Vimeo video embedding
  • πŸ‘οΈ View Source - Toggle between visual and HTML source code modes
  • πŸ› Debug Console - Advanced debugging tools for development
  • ⚑ Next.js Ready - Perfect integration with Next.js
  • πŸ“¦ Lightweight - Minimal dependencies, optimized bundle size
  • ✨ Smart Toolbar - Real-time active state detection for all buttons
  • ⚑ High Performance - Optimized typing experience with zero lag

πŸ“¦ Installation

npm install @akincand/react-editor

πŸš€ Quick Start

import { Editor, defaultPlugins } from '@akincand/react-editor';

function App() {
  return (
    <Editor
      plugins={defaultPlugins}
      placeholder="Start typing..."
      onChange={(content) => console.log(content)}
    />
  );
}

πŸ“š Documentation

For complete documentation, examples, and guides, visit:

πŸ‘‰ https://kuardscreative.gitbook.io/react-editor

Quick Links

🎯 Core Props

Prop Type Default Description
plugins EditorPlugin[] [] Array of plugins to enable
placeholder string "Start typing..." Placeholder text
theme { mode: 'light' | 'dark' } { mode: 'light' } Editor theme
showSourceButton boolean false Show HTML source toggle
debugConsole boolean false Enable debug logging
onChange (content: string) => void - Content change handler
onReady (editor: EditorInstance) => void - Editor ready callback

See full API documentation β†’

πŸ”Œ Built-in Plugins

import { 
  basicFormattingPlugin,  // Bold, Italic, Underline, Strikethrough
  headingsPlugin,         // H1, H2, H3, Paragraph
  listsPlugin,           // Bullet and numbered lists
  alignmentPlugin,       // Text alignment
  linksPlugin,           // Links with modal interface
  videoPlugin,           // YouTube & Vimeo video embedding
  defaultPlugins         // All plugins combined
} from '@akincand/react-editor';

Features by Plugin

  • Basic Formatting: Bold, Italic, Underline, Strikethrough
  • Headings: H1, H2, H3, Paragraph
  • Lists: Bullet List, Numbered List
  • Alignment: Left, Center, Right, Justify
  • Links: Modal-based link insertion with custom text
  • Videos: Responsive video embedding (YouTube & Vimeo)
  • Images: Image insertion with URL, alt text, and custom dimensions
  • Colors: Text and background color selection with color picker

Learn more about plugins β†’

🎨 Theming

<Editor
  theme={{ mode: 'dark' }}
  plugins={defaultPlugins}
/>

Theming guide β†’

πŸ” View Source

<Editor
  plugins={defaultPlugins}
  showSourceButton={true}  // Enable HTML source viewer
/>

πŸ› Debug Mode

<Editor
  plugins={defaultPlugins}
  debugConsole={true}  // Enable debug logging
/>

Debugging guide β†’

πŸ’‘ Examples

Next.js Integration

'use client';

import { Editor, defaultPlugins } from '@akincand/react-editor';

export default function EditorPage() {
  return (
    <Editor
      plugins={defaultPlugins}
      theme={{ mode: 'dark' }}
    />
  );
}

Custom Plugin

import { EditorPlugin } from '@akincand/react-editor';

const myPlugin: EditorPlugin = {
  name: 'myPlugin',
  version: '1.0.0',
  onLoad: (context) => {
    console.log('Plugin loaded!');
  }
};

<Editor plugins={[...defaultPlugins, myPlugin]} />

More examples β†’

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

πŸ“„ License

MIT Β© AkincanD

πŸ”— Links

🌟 Support

If you find this project helpful, please give it a ⭐️ on GitHub!


Made with ❀️ by AkincanD