Table of contents


Components are packages of template, style, behaviour and documentation that live in your application or in static.

Component guides

Components in applications are documented in component guides using the govuk_publishing_components gem. This mounts a component guide at the path /component-guide in development, test and on Heroku review apps.

Find components in these guides:

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]

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" %>

More about Frontend

This page was last reviewed . It needs to be reviewed again by the page owner #publishing-frontend.