Prototype with data using helpful template filters

Use this GOV.UK Prototype Kit plugin to add helpful filters to Nunjucks templates. Rapidly modify and transform data while ensuring it follows the GOV.UK style guide.

Get started
Illustration of an interface with checkboxes and radio buttons being generated from code, floating above a laptop.

Filters are a feature of the Nunjucks templating language that allow you to modify variables. Separated by a pipe symbol (|), they can be chained together, with the output of one filter passed on to the next.

For example, {{ "<p>GOV.UK</p>" | striptags | lower }} will remove the HTML tags, lower-case the remaining string and output gov.uk.

GOV.UK Prototype Filters provides an additional collection of filters which can be used to transform:


Contribute

The project repository is public and we welcome contributions from anyone.

View this project on GitHub