Safe MDX rendering · no dev server

Open an .mdx file. See the document, not the JSX.

Most apps either refuse .mdx or print raw JSX. Twain renders it: known components become real UI, unknown ones become labelled placeholders, and nothing from the file is ever executed.

The short version

MDX is Markdown with components, and it normally needs the project's dev server to look like anything. Twain renders it directly: callouts, tabs, steps, cards and accordions map to safe built-in UI, the component names Docusaurus, Mintlify, Nextra and Fumadocs use are understood out of the box, and anything unrecognised is preserved as a labelled placeholder with its props intact. Imports and expressions are parsed and reported, never run.

How Twain handles the component layer

Three honest outcomes for every tag: real UI, a labelled placeholder, or a diagnostic with a line number.

safe by construction

Semantic MDX rendering Free

Known components map to built-in UI and the output is sanitised every time. No code from the file runs, so an untrusted document stays inert.

labelled placeholders

Unknown components survive Free

A tag Twain has never seen becomes a clearly labelled placeholder with its props and children intact, so the document's meaning survives instead of breaking the render.

framework aware

Component maps Free

Pure-data maps teach the renderer the names Docusaurus, Mintlify, Nextra and Fumadocs use, and a .twain-md.json map teaches it yours. A map can only point at a fixed set of safe built-in renderers, so even a hostile map cannot introduce new behaviour.

x-ray

Import and expression diagnostics Free

Imports and {expressions} are reported with their source lines, so you know exactly what a document assumes before it goes anywhere near a build.

finder

Quick Look for .mdx Free

Press space on an .mdx file in Finder and read it rendered. Almost nothing else on macOS previews MDX at all.

honest editing

Source editing for MDX Pro

Rich MDX stays source-edited with live preview; the WYSIWYG editor is for plain Markdown, where in-place editing can be trusted not to mangle components.

An .mdx guide open in Twain: Cards and a Disclosure render as real UI, and below them an unrecognised ColorPicker component appears as a labelled placeholder showing its props, with its fallback text intact.
Real output: Cards and Disclosure become UI; an unknown ColorPicker becomes a labelled placeholder, not a crash.

Why MDX viewers are rare

Rendering MDX outside its project is hard to do honestly. Executing the components would mean running arbitrary project code on every open, and stripping them throws away the document's meaning. Twain takes the third path: it parses the component layer, maps what it recognises to safe built-in equivalents, and shows what it does not recognise as labelled placeholders.

Made for agent-written docs

Coding agents emit MDX freely because the frameworks they document use it. Twain lets you read those files at full fidelity the moment they land on disk, and anything worth a second look, unknown components, imports, missing images, broken links, appears in the diagnostics panel with its source line.

The same rendering everywhere

The app window, the Finder Quick Look preview and the twain-md CLI all run the identical pipeline, so an .mdx file looks the same wherever you meet it and your CI can check exactly what you saw.

Questions

Does Twain execute the components in my MDX?

No, never. Known component names are mapped to safe built-in renderers, everything else becomes a labelled placeholder, and the output is sanitised. Imports and expressions are parsed for diagnostics but not run.

What happens to components Twain does not recognise?

They render as clearly labelled placeholders with their props and children intact. The document stays readable and you can see exactly what the file expected its project to provide.

Can I teach Twain my own component names?

Yes. A .twain-md.json component map routes your names to the built-in renderers (callouts, tabs, steps, cards, accordions). Maps are pure data and can only select from a fixed set of safe renderers.

Can I edit MDX in Twain?

Yes, in the source editor with live preview, which needs Pro. The WYSIWYG editor is deliberately limited to plain Markdown so it can never mangle a component.

This page describes what the app does today; when a capability is partial or pending, it says so. See how Twain compares to other Mac Markdown apps.

Try Twain

The free viewer, with a 7-day Pro trial built in.