Component playground

Edit a self-contained HTML component and watch it render as you type - at phone, tablet or desktop width, in light or dark, and in either text direction. Every template in the component library is one file, which is exactly what this page renders.

  • WidthsPhone, tablet, desktop
  • ChecksDark mode and RTL
  • SandboxScripts only, no access out

The file

One self-contained HTML document: markup, styles and any script.

60 lines · 2.5 kB

Preview

Rendered in a sandboxed frame; it can run its own scripts and reach nothing here.

Width
Fill
Direction
LTR
Theme
Light

Start from a real one: open any template in the component library and it arrives here with its markup loaded.

Why single-file components

A component that is one HTML file can be previewed by an iframe, read in a sitting, and pasted into any stack - no build step, no dependency graph, nothing fetched at runtime. That is the whole premise of the library this page edits.

What the sandbox allows

The frame runs scripts so a component's own behaviour works, and it is denied same-origin access, forms, popups and navigation. A pasted component cannot read this page, its storage or your cookies.

Check dark and RTL before shipping

Both switches rewrite the document's own attributes rather than forcing styles from outside, so what you see is what the file does on its own. A layout that only mirrors correctly because the parent page helped it is a layout that will break elsewhere.

Frequently asked questions

How do I preview an HTML file without a server?
Paste it here. The page renders the document in a sandboxed iframe from the text itself, so there is nothing to install, serve or deploy - which works because every template in the library is one self-contained file.
Is it safe to paste someone else's HTML here?
The frame runs scripts so a component's own behaviour works, and is denied same-origin access, forms, popups and navigation. Pasted markup cannot read this page, its storage or your cookies.
How do I test a component in right-to-left?
Switch the direction control. It rewrites the document's own dir attribute rather than forcing styles from outside, so what you see is what the file does on its own - a layout that only mirrors because the parent page helped it will break elsewhere.
Can I load a component from the library?
Yes. Open the playground with a slug query parameter and that template's markup arrives loaded and ready to edit.