components / editor

editor.

split-pane markdown editor with a live preview that scrolls and highlights in sync, both ways: select text and a button pushes it to the preview; click a block in the preview and the editor scrolls to it and lays a gray streak over the matching lines. bring your own markdown renderer (e.g. prose). dark-only.

live preview

markdown editor

select any text on the left and a → preview button appears — click it and the matching block on the right scrolls into view and both sides highlight.

the other direction

click any block in the preview. the editor scrolls to it and lays a gray streak over the matching lines.

<Editor value={md} onChange={setMd} renderMarkdown={render} />
  • the streak tracks the textarea's own scroll
  • editor and preview share one source of line numbers
installation
bunx @justin06lee/chrome@latest add editor