@aaruhi/editor
v1.1.1
Published
Professional React Rich Text Editor with Format Painter, Colors, Font Sizes
Maintainers
Readme
Aaruhi Editor
A powerful and customizable React Rich Text Editor inspired by MS Word. Built using modern web APIs (Range + Selection) for better control and flexibility.
Features
- Rich Text Editing (Bold, Italic, Underline)
- Text Color & Background Highlight
- Font Size Control
- Format Painter (Copy & Apply Styles)
- Undo / Redo Support
- Keyboard Shortcuts (Ctrl + B, I, U)
- Fast & Lightweight (No heavy dependencies)
Installation
npm install @aaruhi/editorUsage
method 1
import React from "react";
import Editor from "@aaruhi/editor";
import '@aaruhi/editor/dist/editor.css';
function App() {
return (
<div>
<Editor />
</div>
);
}
export default App;method 2
import React from "react";
import AaruhiEditor from "@aaruhi/editor";
import '@aaruhi/editor/dist/editor.css';
function App() {
return (
<div>
<AaruhiEditor />
</div>
);
}
export default App;
## 🧠 How It Works
Aaruhi Editor uses:
* **Selection API** → to detect selected text
* **Range API** → to apply styles precisely
* **Custom Span Wrapping** → for accurate formatting
This allows better control compared to traditional `execCommand`.
---
## 🎯 Commands Supported
| Command | Description |
| --------- | ----------------- |
| bold | Make text bold |
| italic | Italic text |
| underline | Underline text |
| foreColor | Change text color |
| backColor | Highlight text |
| fontSize | Change font size |
---
## Format Painter
Copy styles from one text and apply them to another — just like MS Word.
---
## ⚙️ Customization
You can customize:
* Editor size
* Toolbar (Ribbon)
* Styles & themes
* Commands behavior
---
## Note
* `document.execCommand` is partially used for compatibility
* Future versions will fully migrate to modern APIs
---
## Future Scope
* Export to PDF / DOCX
* Advanced color picker
* Smart formatting engine
* Copy-paste clean HTML
* Plugin system
---
## Contributing
Contributions are welcome!
Feel free to fork the repo and submit a pull request.
---
## License
MIT License
---
## Author
**Ashutosh Maurya**
---
## Support
If you like this project, please give it a on GitHub!