Hypertekt › Docs › Reference

Built-in components

The components every site has, under ht/: pictures in every size, videos, maps, dialogs and whether the business is open now.

The platform has components of its own, under ht/, for things that are easy to get wrong. A component is used like any partial, {{> ht/youtube id="FC4FHKYZ6oY" title="Letter Attack! trailer"}}, and checked the same way. The components were under core/ until 2026-11-27: a site that still uses one of the old names is told the new name (missing-partial, with the new name as its suggestion). A site’s own partials can’t be in partials/ht/, and its own files can’t be in assets/ht/ (reserved-asset), where the components’ scripts and stylesheets are. A component’s scripts and stylesheets are only served on a site that uses it.

Component What it does
ht/youtube A YouTube video (id=, title=), from youtube-nocookie.com, 16:9 at the width it’s given, loaded when it’s near the screen.
ht/vimeo A Vimeo video (id=, title=).
ht/map A map of the business (or lat= and lng=), with OpenStreetMap tiles, and a link for directions.
ht/picture An image (image=) in the sizes each screen needs, as AVIF and WebP with a JPEG for older browsers. See below.
ht/dialog A dialog that opens from any link or button pointing to it (id=), with its slot as the content.
ht/open-now Whether the business is open now (open= and closed= are the words for each, “Open now” and “Closed now” by default), as each visit is served. See below.
ht/carousel A row of slides that scrolls, one slide per item of its slot.

ht/open-now writes both messages, in a <span> (with class=), and the server keeps the one that’s true as each page is served. The server goes by business.specialHours first, then business.hours, in the site’s time zone. The message is right whenever someone visits, and a page with ht/open-now is never cached. The <span> that’s kept has data-open="true" or "false", for styling. A site with no hours to go by gets a warning (open-now-hours), since the component would always say closed.

ht/picture takes image=, and these optional props: sizes= (how wide the picture is shown, as in <img sizes>), widths= ("400 800 1200", for srcset), crop= ("5:4"), alt= (the image’s own alt text if left out), class=, loading= (lazy by default, or eager), priority=true (the page’s main picture, like the one at the top: it loads right away and before the page’s other pictures, with fetchpriority="high") and format= (the format of the copy for older browsers: jpeg by default, or png for a logo that needs its transparency). Every copy is made once when the site is built, cut around the image’s focus, and never wider than the image itself:

{{> ht/picture image=trainer.photo crop="4:5" widths="400 800" sizes="(min-width: 800px) 400px, 100vw"}}

ht/dialog takes id=, and optionally class= and label= (the dialog’s aria-label, for when nothing inside it says what it is). The dialog’s slot is its content. The dialog opens over the page from any link to its id (href="#contact"), from a button with data-dialog="contact", or from a link to its id on another page (/#contact). It closes with Escape, with a click outside the dialog, or with anything inside it that has data-close. A video inside the dialog stops when the dialog closes. A link in one dialog to another dialog closes the first. The component is a <dialog> element, centered, with no other look of its own: the site styles the dialog by its class, and its backdrop with ::backdrop.

{{#> ht/dialog id="contact" class="contact-dialog" label="Book a free intro"}}
<button type="button" data-close aria-label="Close">×</button>
{{> contact-form}}
{{/ht/dialog}}

ht/map shows the business from site.yaml on an OpenStreetMap map, with a card of its name, address, phone, opening hours and a link for directions. ht/map takes lat= and lng= to show somewhere other than business.geo, and class=. The map fills its container, and is at least 320px tall, so the site sets the map’s height by its class.

An <iframe> written in a template by hand gets a warning (unmanaged-embed) that points to the component, with the video’s id when the frame is a YouTube video.