Skip to main content

This is an exploration of how to prototype the GOV.UK app, not something to build on yet.

Proposed components

Using a component the library doesn’t have yet.

When the library doesn’t have it

A prototype can only use what the component library has. A screen that needs something more has found a gap in the library.

While the library catches up, a component can be proposed here, in components/. It’s written as the library’s own are: a folder with its HTML, CSS, script and definition, using the library’s foundation, with a definition marked proposed. The schema includes it, so a prototype can use it like any other, and it can move into the library as it is.

Chat’s saved details are one:

{
  "type": "chat-saved-details",
  "attributes": { "action": "Continue" },
  "name": "saved-details",
  "action": "submit",
  "children": [
    { "type": "chat-saved-detail", "attributes": { "label": "Date of birth", "source": "From your GOV.UK One Login" }, "name": "use-date-of-birth", "text": "8 March 1993" },
    { "type": "chat-saved-detail", "attributes": { "label": "Monthly rent", "source": "You told Chat on 2 October 2026" }, "name": "use-rent", "text": "£730" }
  ]
}

Adding one

  1. Add the component’s folder to components/, written as the library’s are. The library’s build a component says how.
  2. Mark its definition proposed, with the design it comes from.
  3. Import its script in viewer/main.js, and list its files in the service worker’s FILES.
  4. Run npm run build to add it to the schema, and npm test.