Flat / MDX hosting

MDX hosting: share source files or publish a built site

Publish an MDX source file from your browser or the CLI. Let readers inspect and download it, or build your project locally when you want to share the rendered site.

Checking your upload limits... · Public · Limits

Drop your MDX files here

or choose them from your device.

Select MDX files

What readers see at your MDX link

Flat displays MDX as highlighted source. JSX tags and JavaScript expressions remain code. The screenshot shows a sample MDX document with an exported value and a JSX section.

The viewer does not compile MDX, resolve imports, install dependencies, or mount React components. Downloading the source lets recipients use it in their own compatible MDX project.

A single file opens in the viewer. Several files open in the explorer, where readers can choose a file. Public links need no Flat account. Original downloads remain available if a preview cannot load.

The main link opens Flat's viewer. The exact path /handoff.mdx serves the original file, without changing its contents.

Flat's MDX source viewer displaying an exported project object, JSX tags, and Markdown text with syntax highlighting.
handoff.mdx shown as source without running JSXView full-size screenshot

How to upload MDX files and get a link

  1. Prepare your file

    Save the MDX source as UTF-8. For a source handoff, include the components and other project files the recipient needs, with a note describing the build tool and dependency versions.

    For a rendered website, run your MDX project's static build locally and publish its output folder. See HTML hosting for the finished-site workflow. A source file alone is not a built site.

  2. Publish from your browser or terminal

    In your browser

    Drop, publish, copy the link.

    Drop your finished files into the uploader above, or select them from your device. Enter your email if signed out, then choose "Publish files".

    Selected files need unique names and publish at the top level. Use the CLI for folders; the browser uploader does not accept folders or extract ZIPs.

    Go to uploader
    TerminalNode.js 20+

    One command. Files or folders.

    npx -y @getflat/cli deploy ./handoff.mdx

    Replace the example path with your file. Pass a folder to publish related files with their relative paths intact. The CLI prints the published URL.

  3. Check before sharing

    For source sharing, check JSX and imports in the preview. For a built site, open the output locally, verify component behavior, then deploy and check the published pages.

    Signed-out uploads expire after 1 hour by default. Sign in before expiry to keep them online, or sign in before publishing for no default expiry.

What you can share with MDX hosting

Component documentation source

Share the MDX used by a documentation project so another developer can inspect the markup and component references.

Reproducible content examples

Provide a small MDX example and its dependencies for someone to run with the same local toolchain.

Keep a version, or keep an address.

Share this version

Every upload gets its own link. Publishing revised files creates a new link and leaves the earlier version unchanged. Use the version link when someone needs to review a specific upload.

Update files at one address

Use a named onflat.page address or your own domain. Sign in, then publish with the CLI using --domain. Publish revised files with the same domain to point that address to the new upload.

Named addresses are included on Free. Adding your own domain requires a paid plan. The browser uploader does not set up or repoint these addresses.

MDX hosting questions

Is hosting free, and what are the limits?

Yes. Signed-in Free includes 5 MiB per upload, 1 GiB of storage, and 5 GiB of monthly transfer, with no default expiry. The per-upload limit covers all files in that upload. Paid plans raise these limits.

Compare hosting plans and limits

Do readers need a Flat account?

No. Public links open without a Flat account. Anyone with the link can open the uploaded files. Password-protected links also require the visitor password.

Can I password-protect my upload?

Yes. Password protection is available on every plan. Add --password YOUR_PASSWORD to your CLI deploy command. It protects access to the upload and its files, but does not prevent someone with access from saving a copy. The browser uploader creates public uploads.

Set a visitor password

Can I replace files without changing the link?

A version link always refers to its original upload. For same-address updates, use a named address or your own domain. Publish revised files with the same --domain value in the CLI to point that address to the new upload.

What happens when an upload expires?

Flat stops serving it. An expired upload cannot be recovered. Signed-out uploads expire after 1 hour by default. For browser uploads, use the sign-in link shown after publishing. For CLI uploads, run npx -y @getflat/cli login. Complete sign-in before expiry to keep the upload online. If you chose a shorter expiry in the CLI, that deadline stays in place.

Will my React components run when I upload MDX?

No. The file viewer displays code. Build the MDX with your own toolchain, then publish the static HTML, JavaScript, and assets it produces. Flat does not run a build or a React server for an uploaded source file.

What is different from Markdown hosting?

MDX can include JSX and JavaScript expressions for an MDX compiler. Both MD and MDX uploads appear as source in Flat's viewer. Only a separately built website provides rendered components.

How large can an upload be?

Upload allowances depend on your plan and cover all files in the upload. Compare current plan limits. Preview availability also depends on format and processing support. The original file remains available to download if a preview is unavailable.

Can I embed the viewer on another website?

Flat's generated viewer cannot be embedded in an iframe and keeps Flat branding on every plan. Link to the viewer for reading or to the exact file URL for the original.

Find the guide for your text file.

Give your MDX files a link.

Publish your file, check the preview, and share the URL.

Publish files

Free to start · View pricing

Compare text formats