@pratikkamble199/email-editor
v0.2.6
Published
A React email editor component built with TypeScript and Material-UI
Maintainers
Readme
Email Editor Library
A flexible and customizable email editor component for React applications.
Installation
npm install @yourusername/email-editor
# or
yarn add @yourusername/email-editorPeer Dependencies
This library requires the following peer dependencies:
- react (>=16.8.0)
- react-dom (>=16.8.0)
- @mui/material (>=5.0.0)
- @emotion/react (>=11.0.0)
- @emotion/styled (>=11.0.0)
Usage
import React from 'react';
import { EmailEditor } from '@yourusername/email-editor';
function App() {
const handleTemplateChange = (template) => {
console.log('Template updated:', template);
};
return (
<div style={{ height: '100vh' }}>
<EmailEditor
onTemplateChange={handleTemplateChange}
initialTemplate={{}}
/>
</div>
);
}
export default App;Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| initialTemplate | object | {} | Initial email template data |
| onTemplateChange | (template: object) => void | undefined | Callback when the template is updated |
| components | object | {} | Custom components to override default editor components |
| className | string | '' | Additional class name for the editor container |
| style | React.CSSProperties | {} | Additional styles for the editor container |
Development
- Clone the repository
- Install dependencies:
npm install - Start development server:
npm run dev - Build the library:
npm run build
License
MIT
