GOV.UK Publishing Components is a Ruby gem to document and distribute components for GOV.UK applications.
- 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.
- Install and use this gem
- Use a component in your application
- Generate a new component
- Develop a component
- Run the component guide
- Move a component from an application to the gem
- Publish/release a new version of the gem
- Keep this gem in sync with the Design System
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
Relationship with GOV.UK Design System
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.
Install the application's dependencies with:
bundle install yarn install
Running a local app with a local gem
The GDS Developer Docs has a guide on local frontend development that covers setting up a local app to use the local version of the components gem in Docker and using the
The default rake task runs all the linting and test 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
Preview documentation in your browser with:
bundle exec yard server --reload