@stll/folio-react
v0.7.0
Published
React editor for folio: a Word-document (.docx) editor for the browser, built on @stll/folio-core and ProseMirror.
Maintainers
Readme
@stll/folio-react
A Word-document editor for the browser. It opens a real .docx, lets you edit
it, and writes a real .docx back — preserving pagination, tables, headers and
footers, tracked changes, and footnotes.
The React editor is one layer on top of
@stll/folio-core, the
headless OOXML parser, document model, and page-layout engine.
Part of stella, an open-source legal workspace.
Install
bun add @stll/folio-react react react-dom use-intl@stll/folio-core is installed automatically as a dependency.
Usage
import { DocxEditor } from "@stll/folio-react";
import "@stll/folio-react/editor.css";
export function Editor({ docx }: { docx: ArrayBuffer }) {
return <DocxEditor documentBuffer={docx} onSave={(out) => download(out)} />;
}The editor renders to the DOM; under SSR, load it from a client-only/dynamic import.
Exports
| Import | What it is |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| @stll/folio-react | the React editor and its components |
| @stll/folio-react/editor.css | the single bundled stylesheet — import once; it @imports the document fonts from @fontsource/* (installed as deps), so no external network requests |
For headless, framework-neutral use (OOXML parsing, the document model, the
layout engine, DOCX ↔ Markdown), depend on @stll/folio-core directly.
Peer dependencies
react ^18 or ^19 · react-dom ^18 or ^19 · use-intl >=4
Acknowledgements
folio began as a private fork of Eigenpal's
docx-editor by
Jedr Blaszyk. The code has since been extended
(mostly to match the needs of stella). After the upstream repository was taken
down, we're publishing folio in case the fork is useful to others as well. The
original license and copyright are preserved in NOTICE.md.
