Instructions for AI agents
This page renders Hyper Elements templates (@hyper-elements/react 0.4.0) in the browser, with nothing to install: email HTML and plain text, a web page, print HTML and a PDF, a PNG or SVG image, the template's outline and its diagnostics. Write a module that exports the template (export default function Welcome() { return <Email>…</Email>; }), or JSX alone (<Email><Text>Hi</Text></Email>). The root decides the output: Email, Page, Document or Canvas.
1. WebMCP tools, where the browser has document.modelContext: render_hyper_elements (code, root, include: returns the outputs and diagnostics without changing the page),show_hyper_elements_preview (code, root, view, device: shows it and returns a share link), get_hyper_elements_reference (the guide to read before writing) and get_playground_code.
2. JavaScript: await hyperElementsPlayground.render(code, { root, include }) resolves with { ok, root, html, text, outline, diagnostics, error };await hyperElementsPlayground.setCode(code) also shows it; hyperElementsPlayground.reference() is the guide and hyperElementsPlayground.help() lists every method.
3. A link: open this page with #code=BASE64URL (the UTF-8 code, base64url-encoded), and optionally &view=preview|html|text|pdf|png|svg|clients,&device=phone and &layout=preview (the output alone). The data-render-status attribute of the html element becomes ok or error when it has rendered. Each diagnostic says what's wrong and what to write instead: fix what they say and render again.