☁️ Kitura plugin for type-safe, transformable HTML views.

What's New

Html 0.3.0 / Swift 5 Support


This release brings in support for Html 0.3.0 and Swift 5!


Swift 5 Linux CI @pointfreeco

Kitura plugin for type-safe, transformable HTML views using swift-html.


The most popular choice for rendering HTML in a Kitura web app is to use the Stencil templating language, but it exposes your application to runtime errors and invalid HTML. Our plugin prevents these runtime issues at compile-time by embedding HTML directly into Swift’s powerful type system. It uses the swift-html DSL for constructing HTML documents using plain Swift data structures.


To use the plugin all you have to do is return a Node value from your router callback:

import HtmlKituraSupport
import Kitura

let router = Router()

router.get("/") { request, response, next in
    Node.h1("Hello, type-safe HTML on Kitura!")

Kitura.addHTTPServer(onPort: 8080, with: router)

Take it for a spin

We've included a sample Kitura application in this repo to show off its usage. To run the app immediately, simply do:

  • swift run HtmlKituraSupportExample
  • Open your browser to http://localhost:8080

The HTML for that page is constructed and rendered with swift-html!

If you want to run the app in Xcode so that you can play around with the HTML, try this:

  • git clone
  • cd swift-html-kitura
  • make xcodeproj
  • Select the HtmlKituraSupportExample target
  • Build and run cmd+R
  • Open your browser to http://localhost:8080


If you want to use swift-html-kitura in a project that uses SwiftPM, it's as simple as adding a dependencies clause to your Package.swift:

dependencies: [
  .package(url: "", from: "0.3.0")

Xcode Sub-project

Submodule, clone, or download swift-html-kitura, and drag HtmlKituraSupport.xcodeproj into your project.


All modules are released under the MIT license. See LICENSE for details.


  • Swift Tools 5.0.0
View More Packages from this Author


Last updated: Fri May 26 2023 22:11:40 GMT-0500 (GMT-05:00)