react-rich-input
v0.0.7
Published
A lightweight, customizable rich‑text input React component with extensible toolbar.
Downloads
50
Readme
react-rich-input
A lightweight React rich‑text input component with toolbar customization.
Installation
npm install react-rich-inputor using yarn
yarn add react-rich-inputUsage
import React, { useState } from "react";
import { RichInput } from "react-rich-input";
export default function App() {
const [content, setContent] = useState("<p>Hello world</p>");
return <RichInput value={content} onChange={setContent} toolbar={["bold", "italic", "underline", "link"]} />;
}Props
| Prop | Type | Description |
| ---------- | ------------------------ | --------------------------------------- |
| value | string | HTML content |
| onChange | (html: string) => void | Callback on content change |
| toolbar | string[] | Buttons to show: bold, italic, etc. |
Development
npm run build
npm testLicense
MIT © Javad Amiry
