No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
components
.gitignore
LICENSE
README.md
package.json

README.md

govuk-elements-nunjucks

🚨 Deprecation notice 🚨

The GOV.UK design system now has nunjucks macros - you can find out more on github.

You should look to move to this instead.

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.

Old style radio and checkboxes can be found under retired these can be used with 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

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

UI Graveyard

Contributing

Notice something wrong? Or a feature that is missing?

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

Links