Skip to content

Conversation

@peteryates
Copy link
Member

The design system has supported before_input and after_input params for some time.

They place the provided content before and after the input (or group of inputs, select, etc) within a form component.

Unlike in the Nunjucks macros, here the arguments are placed on the form builder methods directly, rather than within the form group. It makes them easier to document and in this library the form group object only really is responsible for attributes on the form group element, rather than any actual rendering.

image

Fixes #478

These arguments allow content, either text or HTML (via a proc) to be
inserted before and after inputs.

The naming of the arguments follows the GOV.UK Design System - which
isn't ideal as:

* the argument names are plural for dates (before_inputs, after_inputs),
  because there are multiple inputs
* select doesn't have an input element, so the name isn't consistent

Refs #478
@netlify
Copy link

netlify bot commented Jan 4, 2026

Deploy Preview for govuk-form-builder ready!

Name Link
🔨 Latest commit b70905d
🔍 Latest deploy log https://app.netlify.com/projects/govuk-form-builder/deploys/695a97fd5d489b000816f6fe
😎 Deploy Preview https://deploy-preview-598--govuk-form-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider how to support content before and after inputs within a form group

2 participants