@maillayers/core
v0.1.2
Published
Framework-agnostic embeddable email editor engine for the browser
Maintainers
Readme
@maillayers/core
Browser-native embeddable email editor. No React/Vue/Angular required.
Install
npm install @maillayers/coreFor React apps, prefer @maillayers/react (installs core automatically).
Browser-only — requires document and a DOM container. Node ESM imports are supported for tooling when using the published build (.js extension in relative imports).
Quick start
<div id="editor" style="height: 100vh"></div>
<script type="module">
import { MailLayers } from "@maillayers/core";
const editor = new MailLayers({
container: "#editor",
apiKey: "your-api-key",
darkMode: true,
theme: { primary: "#6366F1", secondary: "#64748B" },
});
editor.on("export", ({ html, json }) => {
console.log("HTML bytes:", html.length, "JSON bytes:", json.length);
});
editor.on("change", ({ template }) => {
console.log("template id:", template.id);
});
</script>React
Prefer @maillayers/react for React apps:
npm install @maillayers/react react react-domExports
| Entry | Description |
|-------|-------------|
| @maillayers/core | MailLayers class, theme helpers, types |
| @maillayers/core/render | Headless HTML render utilities |
License
MIT
