Programming language: Swift
License: BSD 2-clause "Simplified" License
Tags: UI     Template    
Latest version: v0.15.1

Stencil alternatives and similar libraries

Based on the "Template" category.
Alternatively, view Stencil alternatives based on common mentions on social networks and blogs.

  • SwiftCssParser

    A Powerful , Extensible CSS Parser written in pure Swift.
  • Themes

    👕👚 Theme management in Swift
  • Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
    Promo www.influxdata.com
    InfluxDB Logo
  • Temple

    🗂️ This repository provides a guide to creating Xcode templates for iOS boilerplate code to save time and increase creativity in development. It simplifies the process and helps new team members get up to speed. A solution to Xcode's poorly documented templates.

Do you think we are missing an alternative of Stencil or a related project?

Add another 'Template' Library



Stencil is a simple and powerful template language for Swift. It provides a syntax similar to Django and Mustache. If you're familiar with these, you will feel right at home with Stencil.


There are {{ articles.count }} articles.

  {% for article in articles %}
    <li>{{ article.title }} by {{ article.author }}</li>
  {% endfor %}
import Stencil

struct Article {
  let title: String
  let author: String

let context = [
  "articles": [
    Article(title: "Migrating from OCUnit to XCTest", author: "Kyle Fuller"),
    Article(title: "Memory Management with ARC", author: "Kyle Fuller"),

let environment = Environment(loader: FileSystemLoader(paths: ["templates/"]))
let rendered = try environment.renderTemplate(name: "article_list.html", context: context)



Stencil follows the same philosophy of Django:

If you have a background in programming, or if you’re used to languages which mix programming code directly into HTML, you’ll want to bear in mind that the Django template system is not simply Python embedded into HTML. This is by design: the template system is meant to express presentation, not program logic.

The User Guide

Resources for Stencil template authors to write Stencil templates:

Resources to help you integrate Stencil into a Swift project:

Projects that use Stencil

Sourcery, SwiftGen, Kitura, Weaver, Genesis


Stencil is licensed under the BSD license. See [LICENSE](LICENSE) for more info.

*Note that all licence references and agreements mentioned in the Stencil README section above are relevant to that project's source code only.