I've been building chat UIs for agents and kept running into the same issues with react-markdown: it re-parses the whole reply on every token, so long answers get noticeably slower, and you see raw ** and half-typed [links](htt until the token that closes them arrives.
So I wrote my own renderer. It parses incrementally and repairs unfinished syntax while the reply streams:
{text}
On a 100k-character reply it takes 0.25 s of main-thread time in total. markdown-to-jsx takes 2.4 s, Streamdown 6.3 s, and react-markdown didn't finish within the 30 s budget. The benchmark scripts are in the repo if you want to check them.
The other part is the syntax. Agents often want to show steps, alternatives or pros and cons, and plain Markdown flattens all of that into bullet lists. So on top of GFM I added a few blocks in the same style as GitHub alerts:
> [!STEPS] 1. **Back up the database** 2. **Run the migration**
There are also tabs, stats, pros/cons, sources, file trees, and Mermaid and KaTeX support.…