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
- Toggle to the File mode at the top of the Spread page.
- Click the file picker; choose a
.htmlor.htmfile from disk. - Tostada reads the file text-only — no upload, no network round-trip.
- Click Spread to run the same pipeline as URL mode, applied to the file's HTML.
- 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
.htmlfile. 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. curl—curl https://example.com > page.htmlfor any page that can be fetched server-side.- Pre-render an SPA — many SPA toolchains have a
prerenderorstatic-buildmode 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/htmlMIME). - 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:
- Make paths absolute. Edit the HTML so paths are
https://example.com/logo.png. - Inline the assets. Inline images as
data:URIs, fonts as base64 in CSS. Tools likeinline-htmlautomate 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.