awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
a-h avatar

a-h/templ

0
View on GitHub↗
10,358 stars·360 forks·Go·MIT·20 viewstempl.guide↗

Templ

Templ is a type-safe HTML templating engine and UI framework for Go. It provides a system for building reusable HTML components that compile into Go code for server-side rendering, ensuring type safety and compile-time validation of data and logic.

The project features a dedicated language server that provides autocomplete and syntax validation for template files within supported code editors. It employs compile-time code generation to transform a custom template language into Go source code, enabling the creation of modular HTML fragments and logic blocks.

The framework includes automated security mechanisms to prevent cross-site scripting through HTML escaping, CSS class and value sanitization, and resource URL validation. It supports various output targets, including streaming content to response writers for web interfaces or producing standalone files for static site generation.

A command line interface is provided to handle the generation of Go source code and the formatting of markup and template files.

Features

  • Compile-Time Code Generation - Transforms a custom template language into type-safe Go source code during the build process.
  • HTML Templating Engines - Implements a type-safe HTML templating engine that compiles templates into Go code for server-side rendering.
  • Template Compilation Tools - Transforms custom template files into type-safe functions that return renderable HTML components during the build phase.
  • HTML Compilation - Compiles a custom templating language into Go source code to produce type-safe user interfaces.
  • Go Code Generators - Transforms template files into idiomatic and type-safe Go source code.
  • Component Compilers - Compiles markup and logic into Go functions that render HTML using loops and conditionals.
  • Cross-Site Scripting Prevention - Automatically escapes user-provided data in HTML attributes and tags to block script injection.
  • XSS Protections - Provides built-in sanitization and encoding to prevent cross-site scripting attacks during HTML rendering.
  • Component Composition - Organizes user interfaces into reusable functions and types that can be nested to build complex pages.
  • Reusable UI Components - Enables the construction of reusable HTML fragments and modular interface elements.
  • HTML Response Renderers - Provides capabilities to write type-safe templates directly to a response writer for delivering web content.
  • Markup Compilers - Transforms declarative HTML-like syntax into optimized, type-safe component structures at build time.
  • Server-Side Rendering - Generates HTML dynamically on the server to serve content to clients.
  • Type-Safe UI Frameworks - Offers a UI framework that ensures type safety and compile-time validation for HTML components.
  • Web Components - Provides a system for creating a library of modular HTML fragments and logic blocks to compose web pages.
  • Web Framework Integrations - Enables rendering dynamic HTML templates within various HTTP routing systems to serve content to web clients.
  • Static Page Rendering - Produces standalone HTML files optimized for deployment on static hosting environments.
  • Language Server Protocol Implementations - Implements the Language Server Protocol to provide real-time syntax highlighting and autocomplete within code editors.
  • Language Servers - Implements the Language Server Protocol to enable autocomplete and syntax validation within supported code editors.
  • URL Protocol Sanitizers - Validates URL attributes to remove JavaScript-based links and ensure only safe protocols are used.
  • Template Syntax Validators - Parses template files during the build process to ensure type safety and structural correctness.
  • Escaping Utilities - Automatically encodes dynamic text content to prevent cross-site scripting and malicious script injection.
  • UI Component Libraries - Templurn supports integrating collections of pre-made HTML elements like buttons and cards into a project.
  • Type-to-Component Mappings - Ties the user interface directly to data structures by returning components from methods attached to types.
  • Static HTML Generators - Outputs rendered component content as standalone static HTML files using standard writer interfaces.
  • Custom Rendering Logic - Allows implementing a component interface using raw code to manually control HTML output generation.
  • Static Site Generation - Renders Go components into standalone HTML files for deployment on static hosting environments.

Star history

Star history chart for a-h/templStar history chart for a-h/templ

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does a-h/templ do?

Templ is a type-safe HTML templating engine and UI framework for Go. It provides a system for building reusable HTML components that compile into Go code for server-side rendering, ensuring type safety and compile-time validation of data and logic.

What are the main features of a-h/templ?

The main features of a-h/templ are: Compile-Time Code Generation, HTML Templating Engines, Template Compilation Tools, HTML Compilation, Go Code Generators, Component Compilers, Cross-Site Scripting Prevention, XSS Protections.

What are some open-source alternatives to a-h/templ?

Open-source alternatives to a-h/templ include: facebook/react — React is a JavaScript library for building user interfaces based on a component-driven architecture and unidirectional… mde/ejs — EJS is a JavaScript templating engine used to generate HTML by embedding executable JavaScript logic and dynamic data… microsoft/fast — FAST is a web components framework and declarative UI library used to build adaptive user interfaces. It functions as… vugu/vugu — Vugu is a Go WebAssembly UI library and framework used to build type-safe, component-based single-page applications.… lit/lit — Lit is a library for building lightweight, interoperable web components. It provides a base class that leverages… reactjs/react.dev — React is a JavaScript library for building user interfaces through the composition of modular, self-contained…

Open-source alternatives to Templ

Similar open-source projects, ranked by how many features they share with Templ.
  • facebook/reactfacebook avatar

    facebook/react

    245,669View on GitHub↗

    React is a JavaScript library for building user interfaces based on a component-driven architecture and unidirectional data flow.

    JavaScriptjavascriptuifrontend
    View on GitHub↗245,669
  • mde/ejsmde avatar

    mde/ejs

    8,105View on GitHub↗

    EJS is a JavaScript templating engine used to generate HTML by embedding executable JavaScript logic and dynamic data into template files. It functions as both a server-side template processor and a client-side rendering engine, allowing for the creation of dynamic markup in both backend and frontend environments. The engine supports the creation of modular web layouts through partial template inclusion, where smaller reusable components are inserted into parent pages. Users can modify the template syntax by defining custom delimiters to avoid conflicts with other languages. The project cove

    JavaScript
    View on GitHub↗8,105
  • microsoft/fastmicrosoft avatar

    microsoft/fast

    9,661View on GitHub↗

    FAST is a web components framework and declarative UI library used to build adaptive user interfaces. It functions as a server-side rendering engine and design system implementation, enabling the creation of modular components based on web standards. The framework focuses on cross-framework component compatibility, allowing user interface elements to remain functional across different front-end frameworks and modern browsers. It implements a design language through a collection of pre-defined visual components to ensure consistency across professional applications. The system covers state-dr

    TypeScript
    View on GitHub↗9,661
  • vugu/vuguvugu avatar

    vugu/vugu

    5,000View on GitHub↗

    Vugu is a Go WebAssembly UI library and framework used to build type-safe, component-based single-page applications. It functions as a single-file component framework that bundles markup, styles, and logic into modular units, utilizing a virtual DOM engine to synchronize state changes with the browser output. The project features a Go component generator that converts custom UI templates into executable Go source code at compile time. It distinguishes itself through a WebAssembly-based runtime that executes application logic as a compiled binary in the browser and a server-side rendering tool

    Goframeworkgogui
    View on GitHub↗5,000
See all 30 alternatives to Templ→