Stilo: an open-source WYSIWYG editor built on ProseMirror (live demo)

Hi everyone,

I’d like to share Stilo, an open-source (MIT) WYSIWYG editor built on ProseMirror. Version 0.2.0 is now out, and there is a live demo you can try in the browser:

Demo: https://kojak8791.github.io/stilo-editor/

What it does

  • Tables (on top of prosemirror-tables): header row, column resize, and handles over rows and columns
  • Find and replace with match count, plus a word and character count
  • Images: paste image files, resize them with side handles
  • Code blocks, task lists, font family and size, text alignment, line spacing, text case
  • Paste cleanup for Word and Google Docs content

Performances

One of Stilo’s main goals is to stay fast on very large documents. The demo site has a performance page where you can load documents with up to 20,000 paragraphs and try it yourself: https://kojak8791.github.io/stilo-editor/performance.html

Links

It is still a 0.x preview, so APIs may change. Feedback is very welcome, especially from people who know ProseMirror’s internals better than I do. And of course, a big thank you to Marijn for ProseMirror itself.

1 Like

Stilo 0.3.0 is out, with wrappers for React, Vue and Svelte:

  • React (stilo-editor/react): a StiloEditor component and a useStiloEditor hook for your own UI. React 18 and 19, SSR, and marked 'use client' for Next.js App Router.
  • Vue (stilo-editor/vue): a component and a useStiloEditor composable. Vue 3.4+, SSR.
  • Svelte (stilo-editor/svelte): a component for Svelte 5, plus actions for Svelte 4 and 5.

One package for everything: the wrappers are subpath exports of stilo-editor, like the UI.

import 'stilo-editor/style.css';

import { StiloEditor } from 'stilo-editor/react';

<StiloEditor content="<p>Hello</p>" onInput={({ editor }) => save(editor.getHTML())} />

Two fixes that may interest people here:

  • Read-only mode is now strict: with editable: false, commands that would change the document return false (also from .can()), and the toolbar disables its buttons.
  • Select all on huge documents is much faster: the toolbar refresh after select all on 50,000 paragraphs went from 11 s to 1 s.

Each framework has its own guide in the repo: https://github.com/kojak8791/stilo-editor/tree/main/docs/frameworks

Full changelog: stilo-editor/CHANGELOG.md at main · kojak8791/stilo-editor · GitHub