Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

GOV.UK Publishing Components · status JavaScript Style Guide

GOV.UK Publishing Components is a Ruby gem to document and distribute components for GOV.UK applications.

It provides:

  • a shared library of components
  • helpers to generate component payloads
  • an application to preview components and provide guidance

Components should be added to this gem if they are required in more than one application, otherwise they should be added to that application.

How to

Architecture / structure


There are 2 types of helper classes in this app:

  • AppHelpers. Are exposed to the applications using this gem. They should be documented using RDoc.
  • Component Presenters. Anything in these classes is only for use within the components. They should be marked @private.

Relationship with GOV.UK Design System

GOV.UK Publishing Components also makes GOV.UK Design System styles and components available to GOV.UK's frontend applications. This gem consumes GOV.UK Frontend via Yarn.

Browser and assistive technology support

GOV.UK Publishing Components shares the same standards in terms of browser and assistive technology support with GOV.UK Frontend.


See the documentation

Working locally

Install dependencies

As well as the Ruby, you will also need the Yarn package manager to allow installing npm dependencies.

Install the application's dependencies with:

bundle install
yarn install

Running tests

The default rake task runs all the linting and test tasks:


Javascript is tested using Jasmine and the Jasmine gem. Tests can be run either in the browser or on the command line via the dummy app’s tasks:

# browser
bin/rake app:jasmine

# command line
bin/rake app:jasmine:ci

Viewing the component guide

View the component guide in your browser with:


The guide should be available at http://localhost:3212

View documentation

Preview documentation in your browser with:

bundle exec yard server --reload


MIT Licence

You can’t perform that action at this time.