medium-proeditor
Version:
A powerful & customizable Medium-style rich text editor
173 lines (119 loc) β’ 6.33 kB
Markdown
<p align="center">
<a href="https://github.com/abdulrahman-mh/medium-proeditor">
<img src="https://raw.githubusercontent.com/abdulrahman-mh/medium-proeditor/main/images/preview.oblique.png" alt="Medium ProEditor logo" width="600" />
</a>
</p>
<h2 align="center">A powerful & customizable Medium-style rich text editor</h2>
<br>
**Hit Star** β & check out the [Live Demo](https://medium-proeditor.vercel.app/)
Medium ProEditor is the ultimate Medium-style rich text editorβfast, powerful, and highly customizable. You can use it for blogs, managing CMS, online collaboration, and anything from drafting to publishing. Built for flexibility, it supports both client-side and server-side workflows with real-time collaboration. it's really Pro ππ
## Why Use Medium ProEditor?
- π **Fast**: Lighter & more optimized than Mediumβs editor (**benchmark in progress...**) thanks to [prosemirror](https://prosemirror.net/).
- β‘ **AI-Powered Autocomplete (Coming Soon π€)**: Add AI to your editor
- π¨ **Customizable**: Plugin-based architecture easy for customization.
- π **Rich Media Support**: Images, videos, tooltips, popups, and more.
- β¨οΈ **Markdown Support**: Enjoy with cool **Markdown editing shortcuts**.
- π **Smart Document Handling**: Version history, backend sync, and real-time collaboration.
- π **Multi-Language Support**: Built-in localization & LTR-RTL support.
- π¦ **Tree-shakeable**: Bundle only the features you need.
- π **Framework-Agnostic**: Works with [**React**](https://react.dev/), [**Vue**](https://vuejs.org/) , [**Svelte**](https://svelte.dev/), **Vanilla JS**, and more.
- β **Love this project?**: Star β the repo.
### **Medium-ProEditor VS Official Medium Editor**:
Soon, you can help with that.
### **Benchmark**:
Soon, you can help with that.
## β‘ Quick Start
Install Medium-ProEditor:
```bash
npm install medium-proeditor
```
Plain javascript usage
```javascript
import 'medium-proeditor/themes/medium.min.css'; // Editor themes
import { Editor } from 'medium-proeditor';
// Import some features
import { HighlightMenu, InlineTooltip, Media, Emoji } from 'medium-proeditor/features';
const editor = new Editor({
// Add some features to your editor
features: [
HighlightMenu, // Add highlight menu
InlineTooltip, // Add inline tooltip menu
Media, // Adds support for embedding media (images, videos, etc.)
Emoji, // Add Emoji menu, type ':' to select your emoji
],
});
```
React Usage
```javascript
import 'medium-proeditor/themes/medium.min.css';
import { useEffect, useRef } from 'react';
import { Editor } from 'medium-proeditor';
import { HighlightMenu, InlineTooltip } from 'medium-proeditor/features';
const EditorComponent = () => {
const editorRef = useRef(null);
const [editor, setEditor] = useState(null); // Store editor instance
useEffect(() => {
if (editorRef.current) {
// Create an editor instance
const editor = new Editor({ features: [HighlightMenu, InlineTooltip] });
setEditor(editor);
}
// Cleanup the editor
return () => {
editor?.destroy();
setEditor(null);
};
}, []);
return (
<div>
<h1>Medium Pro Editor in React</h1>
<div ref={editorRef} />
</div>
);
};
```
## π **Support & Donate**
Medium-ProEditor is built with passion and **100% open-source**! If youβd like to help:
π **Sponsor Medium-ProEditor**
β **[Buy Me a Coffee](#) (Soon i will have a account)** β Every donation keeps the project alive!
β **[Star the Repo](#)** β Stay updated and support the project!
## π€ Contributing
Any Contributing are welcome, open [CONTRIBUTING.md](./CONTRIBUTE.md) for more
## Editor Keyboard Shortcuts
| Feature | Mac Shortcut | Windows/Linux Shortcut |
| ----------------------- | ------------------- | ---------------------- |
| **Text Formatting** | | |
| **Bold** (**B**) | β + B | Ctrl + B |
| _Italic_ (_I_) | β + I | Ctrl + I |
| Add Link | β + K | Ctrl + K |
| Header (H1) | β + Opt + 1 | Ctrl + Alt + 1 |
| Subheader (H2) | β + Opt + 2 | Ctrl + Alt + 2 |
| Blockquote | β + Opt + 5 | Ctrl + Alt + 5 |
| Horizontal Line | β + Enter | Ctrl + Enter |
| Code Block | β + Opt + 6 | Ctrl + Alt + 6 |
| Line Break | Shift + Enter | Shift + Enter |
| **Lists & Indentation** | | |
| Outdent List | β + [ / Shift + Tab | Shift + Tab |
| Indent List | β + ] / Tab | Tab |
## Editor Editing Shortcuts
| Feature | Syntax |
| ------------ | ----------------------------------------- |
| Ordered List | Start with `1. ` (or any number + dot) |
| Bullet List | Start with `* ` (asterisk + space) |
| Code Block | Use triple backticks ` ``` ` |
| Inline Code | Wrap text with backticks (e.g., \`code\`) |
| Emoji Picker | Type `:` then search for an emoji |
## Markdown Shortcuts (Requires `markdownShortcuts` options to be enabled)
| Feature | Syntax Example |
| ------------------- | -------------------------------------------- |
| Blockquote | Type `>` for blockquote, `>>` for pull quote |
| **Bold** Text | Type `**bold**` or `__bold__` |
| _Italic_ Text | Type `_italic_` or `*italic*` |
| Horizontal Line | Type `---` for a divider |
| # Big Title (H1) | Type `# Title` |
| ## Small Title (H2) | Type `## Subtitle` |
**Tip:** These shortcuts also work when pasting formatted text!
---
## Technology
Medium ProEditor is built with [ProseMirror](https://prosemirror.net/)βa toolkit for building rich-text editors on the web.
MIT, commercial use requires a license. | Β© [Abdulrahman Mahmoud](https://github.com/abdulrahman-mh)