RAFT
#71

Create custom macros

Components and Patterns · Practitioner

What is this skill?

Creating custom macros involves building your own reusable Nunjucks components that accept parameters and output HTML, similar to how GOV.UK Frontend components work.

Why is it important?

  • Reusability – Build once, use across multiple pages
  • Consistency – Ensure the same pattern looks identical everywhere
  • Maintainability – Update the macro once to fix issues everywhere
  • Team efficiency – Share components with colleagues

Where to learn more