PrototypingBuilding your prototype

In Atom, select File then Open. Then select your prototype folder.

Overview of folders in your prototype

  • /common is for your work. Inside that folder:
  • page-wrap.tsx is where you change your service name and update your header and footer links
  • pages is for HTML or React pages
Text editor screen showing prototype file structure

Create and modify pages

You can use both HTML (.html) and React (.tsx) to build your prototype. If you are more comfortable using HTML, enter in terminal:

  • npm run create:page
  • answer the prompts to choose either HTML or React
  • edit the new page to suit you
Remove index.tsx from your prototype as having both .tsx and .html with the same index name will create problems in your prototype.

Change the service name

  1. open page-wrap.tsx from the pages folder.
  2. find title="My new service" and change that to your new service name. Press Cmd+S to save your changes.
  3. check http://localhost:8080 to preview the changes
Text editor screen showing changes in code for updating navigation and footer

Update the sub-navigation and footer links

  1. open page-wrap.tsx from the pages folder.
  2. replace navigation with new sub-navigation and footer links. Press Cmd+S to save your changes.
  3. check http://localhost:8080 to preview the changes
Text editor screen with a highlight around where service name could be updated

Using components

There are several ways to use components in your prototype:

  • copy the code from the HTML or React tabs in the design system
  • copy the code from GOV.UK design system (HTML only, not Nunjucks)
Currently, if you are using any components that contains javascript (like tabs or accordions) we advise you use the React code as the functionality will work much better. The files must be saved as .tsx files.

Using HTML

1. Copy the HTML code

HTML code displayed for status banner

2. Open your prototype in Atom and find index.html. Delete the contents of the file and paste in any HTML code you want to use between the fragment tags. Save your changes.

Text editor screen with a highlight around where example code snippet should sit

3. Go to http://localhost:8080/ and you will see the changes update automatically in your local web browser.

Local web browser displaying properly coded status banner