I've been building a visual editor for HTML + Tailwind, and I published the editor as an npm package so you can put it in your own site or app. You select, drag and style like Figma, and every change is real Tailwind classes in plain HTML. There is no export step and no format of its own.
The smallest version
One file:
<div id="root"></div>
<script type="module">
import { startEditor } from "https://cdn.jsdelivr.net/npm/windcraft-editor/editor/index.js";
startEditor(document.getElementById("root"), {
html: '<h1 class="p-10 text-4xl font-bold">Hello</h1>'
});
</script>
Edit the heading on the canvas and the HTML follows. Set new HTML from code and the canvas follows.
Three ways to use it
-
startEditorruns the editor as a whole page and saves designs in the browser. -
mountEditorsaves to your own server, through a few functions you write. -
embedEditorputs it in one box of a page, such as a CMS field or a form. You read the HTML back withgetHtml()oronChange.
It works with React, Vue and Next: serve the package folder as static files and import it from an effect. The docs have the snippets.
What you get
- Zero dependencies, no build step, MIT licensed
- 89 files, about 820 kB to download (2.7 MB unpacked)
- Plain Tailwind HTML in and out, so it fits whatever you already render
Honest limits
It loads Tailwind's play CDN inside the editor, and I have only tested it in Chrome so far. Safari and Firefox are next.
Try it
- Live demo, no sign-in: https://windcraft.swapniljadhav.com/editor/demo/index.html
- npm:
npm i windcraft-editor - Docs and recipes, including a backend example: https://github.com/Tolaj/windcraft/blob/main/docs/editor/README.md
- Source: https://github.com/Tolaj/windcraft
If you embed it somewhere, I would like to hear what got in the way.

Top comments (0)