Elementary: HTML Templating in Pure Swift
December 8, 2025 ยท View on GitHub
A modern and efficient HTML rendering library - inspired by SwiftUI, built for the web.
Important
Elementary has ๐ฆ moved ๐ฆ to its new home at https://github.com/elementary-swift.
Please update your URLs to avoid trouble - and reach out if anything breaks!
This packages helps you serve Elementary HTML web apps with Vapor.
Simply wrap HTMLResponse around your HTML content and return it from your routes.
import Vapor
import VaporElementary
let app = try await Application.make(.detect())
app.get("index") { _ in
HTMLResponse {
MyIndexPage()
}
}
Check out the docs in the Elementary repo for more information.