Prototyping
Setting up coded prototypes
Learn how to create prototypes using the GOV.UK Prototype Kit and the MOJ Design System.How to add the MOJ Design System to a prototype
The MOJ Design System should only be used alongside the GOV.UK Design System. You’ll need a GOV.UK prototype to add MOJ Design System components to.
If you do not already have a GOV.UK prototype, you can find out how to create a new prototype.
How to install the MOJ Frontend npm package
- Open a command prompt (for example Terminal on a Mac).
- Navigate to your prototype folder by typing
cdfollowed by the folder path (for examplecd ~/Documents/prototypes/juggling-licence) - Run
npm install @ministryofjustice/frontend --save
If you’re using version 13 or later of the GOV.UK Prototype Kit, you can now use MOJ Design System components in your prototype.
If you’re using a version earlier than 13, you need to:
- Open
app/assets/javascripts/application.js - Add a new line underneath
window.GOVUKFrontend.initAll(), and typewindow.MOJFrontend.initAll() - Save the file.
Updating MOJ Frontend
The current version of MOJ Frontend is 7.1.1.
Check which version of MOJ Frontend is installed in your prototype
- In the footer of your prototype, select the ‘Manage your prototype’ link.
- Select the ‘Plugins’ link, then select ‘Installed plugins’.
- Look for ‘Frontend by Ministryofjustice’ in the list of plugins. The version number is below.
Update to the latest version of MOJ Frontend
- Check the latest MOJ Frontend release notes for breaking changes that might affect your prototype.
- In the footer of your prototype, select the ‘Manage your prototype’ link.
- Select the ‘Plugins’ link, then select ‘Installed plugins’.
- Look for ‘Frontend by Ministryofjustice’ in the list of plugins and select the ‘Update’ button.