Skip to content

dwpdigital/govuk-elements-nunjucks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

govuk-elements-nunjucks

GOVUK elements, nunjucks style.

This includes a selection form macros from GOV.UK elements, these are using nunjucks and provide a component that can be configured, this encapsulates - text, data, error state, classes and values.

This is a mirror of govuk-elelemt-marko in nunjucks.

This currently is to work with old style radio buttons and checkboxes. (GOV.UK elements v2.1.2 or GOV.UK Frontend Toolkit pre 4.17.0)

Tests

Tests can be ran by running 'npm run test' this will run xo linter and the specs against each component.

Information

Components with defined schemas.

Current components:

  • gov-checkboxes
  • gov-date-input
  • gov-error-summary
  • gov-input
  • gov-radio
  • gov-select
  • gov-textarea

Things to add/improve

  • common approach to data-attributes
  • update radios to be new style

Examples

gov-input has the following inputs

name
id
label
hint
value
error
maxlength

This will need to be exposed in the nunjuck render and can be called like this:

{% from 'gov-input/macro.njk' import govInput %}

{{ govInput(name='input', label='This is a label') }}

Documentation

Contributing

Notice something wrong? Or a feature that is missing?

Feel free to open an issue, or fork and do a pull request.

Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 80.2%
  • HTML 19.8%