The component system
Components are packages of template, style, behaviour and documentation. Components live in your application unless needed by multiple applications, then they are shared using the govuk_publishing_components gem.
Component guides
Components in applications are documented in component guides using the govuk_publishing_components gem. It mounts a component guide at the path /component-guide
.
Find components in these guides:
- govuk_publishing_components component guide
- government-frontend component guide
- calendars component guide
- collections component guide
- finder-frontend component guide
Building components
A component must:
The govuk_publishing_components gem provides a generator to stub the files you’ll need in each component:
bundle exec rails generate govuk_publishing_components:component [component_name]
For example, a lead paragraph component would be included in a template like this:
<%= render 'components/lead-paragraph', text: "A description is one or two leading sentences" %>
This page was last reviewed on 8 October 2019.
It needs to be reviewed again on 8 April 2020
by the page owner #govuk-frontenders
.
This page was set to be reviewed before 8 April 2020
by the page owner #govuk-frontenders.
This might mean the content is out of date.