The project is in a healthy, maintained state
UK.GOV form builder ready for use in Katalyst projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Katalyst::GOVUK::Formbuilder

Repacking of GOV.UK Frontend and GOV.UK form components for use in Katalyst projects.

Installation

Add this line to your application's Gemfile:

gem "katalyst-govuk-formbuilder"

And then execute:

$ bundle

Or install it yourself as:

$ gem install katalyst-govuk-formbuilder

Usage

Add the stylesheet to your default layout:

<%= stylesheet_link_tag "katalyst/govuk/formbuilder" %>

Some GOVUK components require javascript enhancements (see GOVUK docs).

You can use the provided helper to load the formbuilder esm from importmaps and enhance your form:

<%= form_with ... %>
<%= govuk_formbuilder_init %>

You'll need to include the helper to make this method available, which you can add to your ApplicationController:

helper Katalyst::GOVUK::Formbuilder::Frontend

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/katalyst/govuk-formbuilder.

Release

Update the version number in lib/katalyst/govuk/formbuilder/version.rb and run:

bundle exec rake release

License

The gem is available as open source under the terms of the MIT License.