Get started
Prototyping
Create and iterate on rich and responsive prototypes to test your assumptions.
Contents
Figma
In the early stages, Figma can be used as a prototyping tool.
Create a copy of the National Archives base Figma document to start designing your pages.
HTML
Use the GOV.UK Prototype kit to create rich, interactive and responsive prototypes.
The National Archives frontend includes support for the GOV.UK Prototype Kit. You can use the supplied components and styles with the prototype kit to make prototypes that look like National Archives services.
Create a new National Archives prototype
- Create an empty directory
mkdir my-new-prototype
- Enter the new directory
cd my-new-prototype
- Use
npx govuk-prototype-kit create
to create a new prototype project - Install the frontend styles with
npm install @nationalarchives/frontend
- Run
npm run dev
to start up the prototype kit - Visit localhost:3000 in your browser to see the prototype
Adding custom styles
- Create a new SCSS file in
app/assets/sass
calledcustom.scss
(or whatever you prefer) - Create a new layout in
app/views/layout
calledbase.html
(or whatever you prefer) which extends the National Archives prototype kit layout - Set a default
theme
(see theme colours) andthemeAccent
(see accent colours) - Link in your custom CSS file
- Ensure new pages extend your new layout with
{% extends "layouts/base.html" %}
Example layout
{% extends "nationalarchives/templates/layouts/_prototype-kit.njk" %}
{% set theme = "dark" %}
{% set themeAccent = "yellow" %}
{% block pageTitle %}My Service - The National Archives{% endblock %}
{% block stylesheets %}
{{ super() }}
<link href="/public/stylesheets/custom.css" rel="stylesheet" type="text/css" />
{% endblock %}
Using the components in your prototype
The National Archives components can be included in your prototype using the templating language Nunjucks.
Examples are given in the components section. Each component example shows all the Nunjucks options available to that component.
Nunjucks
{% from "nationalarchives/components/button/macro.njk" import tnaButton %}
{{ tnaButton({
text: "Button",
href: "#"
}) }}