HyperTemplates Directives Reference


The core of HyperTemplates is a small but mighty set of ht-* prefixed HTML attributes called templating directives that allow you to compose complex HTML documents from simple HTML templates.

ht-include
Includes the HTML fragments from external sources in place of target elements. Learn more
ht-if
Removes target HTML elements if one or more conditional are not met. Learn more
ht-each
Iterates over a data collection and templates the target HTML element once per item. Learn more
ht-apply
Replaces template variables with strings, or Text and Element nodes. Learn more
ht-block
Progressively enhances the target HTML element. Learn more
ht-attrs
Annotates the target HTML element with one or more HTML attributes. Learn more
ht-base
Resolves relative URLs by providing a base URL to be used within some portion of a template. Learn more
ht-pipe
Moves the target HTML element or its contents to a destination element. Learn more

This is the complete set of template directives used by HyperTemplates. They were designed to be easy to learn and remember.

NOTE: HyperTemplates supports the data- prefix for all template directives (e.g. ht-include is the same as data-ht-include).

💬 Join the community

Stay up-to-date with the latest releases and other news from the Team behind HyperTemplates. Ask the developers questions, get help from the community, and share your creations! 🎨