SemText

Reference · SemText · Prose & code

<sem-browser>

SemText element

It gives the document an address bar and a window frame, while everything inside stays real, working SemText. Use it when a page demonstrates a document rather than being one.

Draws a browser-style window around a live SemText document. It gives the document an address bar and a window frame, while everything inside stays real, working SemText. Use it when a page demonstrates a document rather than being one. (optional): VFS path or URL of the SemText document to render. With no `src`, the element's authored children are the viewport content. (optional): tab-label override. Priority: `label`, then the document's `<title>`, then the `src` basename, then `untitled`. (property only, not an attribute): a host-injected `(path) => string | null | Promise<string | null>` consulted for scheme-less paths (`demo/deck.sem.html`, not `/…` or `https://…`) before any fetch. Returning a string adopts it; returning null errors without fetching. per the global attribute catalog (conventions.md §2) per the global attribute catalog (conventions.md §2) per the global attribute catalog (conventions.md §2) per the global attribute catalog (conventions.md §2)

Example

sem-browser.html
source
1 <sem-browser src="/demo/example-deck.sem.html" label="the deck">
2 <!-- zero-JS fallback chrome: inert glyphs, address pill, framed deck -->
3 <figure class="code-window">
4 <div aria-hidden="true">← → ⟳</div>
5 <div>demo/example-deck.sem.html</div>
6 <iframe src="/demo/example-deck.sem.html" title="the deck" loading="lazy"></iframe>
7 </figure>
8 </sem-browser>
render

Live render boots with JavaScript — the authored source is alongside.

Source: spec/schema/sem-browser.md