Editor and preview

Editor edits a document, Preview renders it the way the site shows it. Both take the same plugins. The preview brings only the styling it needs itself; headings, paragraphs and lists take the page's typography — here Tailwind's prose.


Editor beside its preview

Bind value and render it with Preview. Type / on an empty line for the block menu; drag a block by its handle.

Blocks in, JSON out

Brickee edits a document as blocks: each line is one, dragged by its handle and turned into another type from its menu. Type / on an empty line to add one.

  • Text, headings, lists, to-dos, quotes, code and dividers are markdown.
  • Everything else is a plugin — like the table below.
    • Plugins are plain objects; pass the ones you want.
  • Try the slash menu
  • Write your own block
BlockStored asMarkdown
Paragraphmd:ptext
TabletableGFM table
Videoyoutubelink

A document is just JSON: store it as it is, render it with the same plugins.

<Editor bind:value plugins={PLUGINS} />
<Preview blocks={value} plugins={PLUGINS} />

A plain markdown editor

Leave out plugins and you get the markdown blocks alone. The value is never [] after mount — test emptiness with blocksToPlainText.

The document is empty.


Read-only

With readonly the editor shows the document without handles, menus or fields.


Restricting the block menu

Narrow what an editor offers with palette, not by dropping plugins: a stored document may still hold the others.