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 can be ran by running 'npm run test' this will run xo linter and the specs against each component.
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
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') }}
Notice something wrong? Or a feature that is missing?
Feel free to open an issue, or fork and do a pull request.