HTML file mode

Route: Spread → File tab

File mode is the escape hatch when URL mode can't reach your page — auth walls, SPA hydration, intranet hosts.

How it works

  1. Toggle to the File mode at the top of the Spread page.
  2. Click the file picker; choose a .html or .htm file from disk.
  3. Tostada reads the file text-only — no upload, no network round-trip.
  4. Click Spread to run the same pipeline as URL mode, applied to the file's HTML.
  5. Drag the slider to compare.

Getting the HTML

Several options depending on the source:

  • Browser "Save As" — File → Save Page As → "Webpage, Complete." Use the saved .html file. Assets (images, CSS) won't be inlined; the spread preview shows broken images, which is fine for evaluating the design but not for sharing the output.
  • curlcurl https://example.com > page.html for any page that can be fetched server-side.
  • Pre-render an SPA — many SPA toolchains have a prerender or static-build mode that outputs HTML files. Run that, then drop the result in.
  • Hand-craft — paste any HTML into a file. Useful for previewing how your library handles a specific component or pattern.

Size and format limits

  • Plain text HTML only (text/html MIME).
  • No size limit beyond what the browser allows for FileReader.readAsText (in practice, tens of MB).
  • Binary files are rejected.

Asset paths

Relative paths in the HTML (<img src="logo.png">) will fail to load — there's no base URL for relative paths to resolve against. Two workarounds:

  1. Make paths absolute. Edit the HTML so paths are https://example.com/logo.png.
  2. Inline the assets. Inline images as data: URIs, fonts as base64 in CSS. Tools like inline-html automate this.

For a quick preview where missing images are acceptable, neither is necessary.

When to use file mode vs URL mode

Source Use
Public static page URL mode
Public SPA File mode (after pre-render)
Auth-required app File mode (save manually first)
Intranet host File mode
Pasted HTML / fixture File mode
Anything you want to keep private File mode (no proxy round-trip)

What still doesn't work

The same limitations as URL mode — see URL mode → What doesn't work today. The bottleneck is the spread pipeline, not the source.