1.0.2 • Published 10 months ago
@maciejkociela/website-editor v1.0.2
Web Editor
A lightweight and customizable React-based web editor component.
Installation
npm install web-editor
# or
yarn add web-editorUsage
import { Editor } from 'web-editor';
function App() {
const handleChange = (value: string) => {
console.log('Editor content:', value);
};
return (
<Editor
initialValue="Hello, World!"
onChange={handleChange}
className="custom-editor"
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| initialValue | string | '' | Initial content of the editor |
| onChange | (value: string) => void | undefined | Callback function that is called when the editor content changes |
| className | string | '' | Additional CSS class name for the editor container |
Development
- Clone the repository
- Install dependencies:
npm install - Start development server:
npm run dev - Build the package:
npm run build
License
MIT