How we work Prototyping
This guide explains how to create prototypes using the MOJ Pattern Library and GOV.UK Prototype Kit.
Use a template from Cloud Platform
You can follow the MOJ Cloud Platform guide to automatically set up a GitHub repository containing the GOV.UK Prototype Kit and a hosting environment.
This template comes with the MOJ Pattern Library pre-installed so you don't need to set it up manually. However you may need to update it using the instructions below.
Manual installation
Alternatively, you can install the GOV.UK Prototype Kit and MOJ Pattern Library manually. You must follow the GOV.UK Design System prototype setup guide first. Once you've done that, continue below.
Installing MOJ Frontend
The MOJ Pattern Library uses MOJ Frontend. To install it, run these steps:
- open Terminal
- change the directory to your prototype. For example,
cd path/to/prototype
- run
npm install @ministryofjustice/frontend --save
- add
window.MOJFrontend.initAll()
toapp/assets/javascripts/application.js
below the line doing the same forGOVUKFrontend
Updating MOJ Frontend
The current version of MOJ Frontend is 0.2.1.
You can check which version your prototype is running by opening package.json
in the root folder of your prototype. Look for "@ministryofjustice/frontend"
under "dependencies"
.
To update your prototype to the latest version of MOJ Frontend:
- open
package.json
in the root folder of your prototype in a text editor - Under
dependencies
, update the reference to MOJ Frontend to"@ministryofjustice/frontend": "0.2.1",
- save
package.json
- open Terminal/command line
- change the directory to your prototype's directory. For example,
cd path/to/prototype
- run
npm install