📐 Design System Showcase

A comprehensive demonstration of your custom color palette and all GOV.UK Design System components. Every element uses your WCAG 2.1 compliant 5-color palette plus white and black.

🎨 Color Palette

Click any color to copy its hex code to your clipboard.

Click to copy

Primary Magenta

#7130a6
Contrast: 7.85:1
✅ WCAG AAA
Click to copy

Secondary Purple

#5445d9
Contrast: 6.50:1
✅ WCAG AA
Click to copy

Tertiary Blue

#3D6DDB
Contrast: 4.76:1
✅ WCAG AA
Click to copy

Accent Pink

#a82d7d
Contrast: 6.29:1
✅ WCAG AA
Click to copy

Warning Coral

#b83241
Contrast: 5.88:1
✅ WCAG AA

How to Use These Colors in CSS

Our design system provides CSS custom properties for easy access:

/* CSS Custom Properties Available */ :root { --color-1: #7130a6; /* Primary Magenta */ --color-2: #5445d9; /* Secondary Purple */ --color-3: #3D6DDB; /* Tertiary Blue */ --color-4: #a82d7d; /* Accent Pink */ --color-5: #b83241; /* Warning Coral */ --color-white: #ffffff; --color-black: #000000; } /* Usage Examples */ .my-element { background-color: var(--color-1); color: var(--color-1-text); } /* Utility Classes Available */ .bg-color-1 { background: #7130a6; color: #fff; } .bg-color-2 { background: #5445d9; color: #fff; } .text-color-1 { color: #7130a6; } .border-color-1 { border-color: #7130a6; }

Tier 2: Semantic Colors (What Colors Do)

How your palette colors are assigned semantic meaning.

Primary

Primary Magenta

Main brand color for buttons, links, and primary actions.

#7130a6
Secondary

Secondary Purple

Supporting elements, secondary buttons, and highlights.

#5445d9
Tertiary

Tertiary Blue

Special content areas and accent elements.

#3D6DDB
Accent

Accent Pink

Focus states, important highlights, and call-to-action elements.

#a82d7d
Warning

Warning Coral

Warnings, alerts, and important notifications.

#b83241
/* Semantic Color Variables */ :root { --primary: var(--color-1); /* #7130a6 */ --secondary: var(--color-2); /* #5445d9 */ --tertiary: var(--color-3); /* #3D6DDB */ --accent: var(--color-4); /* #a82d7d */ --warning: var(--color-5); /* #b83241 */ } /* Usage */ .primary-button { background: var(--primary); } .secondary-button { background: var(--secondary); } .focus-outline { outline: 3px solid var(--accent); }

✍️ Typography

GOV.UK typography styles with proper hierarchy and accessibility.

Heading Examples

Extra large heading (xl)

Large heading (l)

Medium heading (m)

Small heading (s)

Body Text

Large body text for lead paragraphs and important content.

Regular body text for most content. This is the standard paragraph style.

Small body text for less important information and metadata.

Lists & Typography

  • Bulleted list item with link
  • Second item with badge
  • Third item with emphasis strong text
  1. Numbered list item
  2. Second numbered item
  3. Third numbered item

Captions & Labels

Caption for extra large heading

Main page heading

Caption for medium heading

Section heading

<!-- Headings --> <h1 class="govuk-heading-xl">Extra large heading</h1> <h2 class="govuk-heading-l">Large heading</h2> <h3 class="govuk-heading-m">Medium heading</h3> <h4 class="govuk-heading-s">Small heading</h4> <!-- Body text --> <p class="govuk-body-l">Large body text</p> <p class="govuk-body">Regular body text</p> <p class="govuk-body-s">Small body text</p> <!-- Lists --> <ul class="govuk-list govuk-list--bullet"> <li>Bulleted list item</li> </ul> <ol class="govuk-list govuk-list--number"> <li>Numbered list item</li> </ol> <!-- Captions --> <span class="govuk-caption-xl">Caption text</span> <h1 class="govuk-heading-xl">Main heading</h1>

📐 Layout & Grid

GOV.UK responsive grid system for creating flexible layouts.

Grid Columns

Full width column (govuk-grid-column-full)

Two thirds column (govuk-grid-column-two-thirds)

One third column (govuk-grid-column-one-third)

Half column (govuk-grid-column-one-half)

Half column (govuk-grid-column-one-half)

Quarter (govuk-grid-column-one-quarter)

Quarter (govuk-grid-column-one-quarter)

Quarter (govuk-grid-column-one-quarter)

Quarter (govuk-grid-column-one-quarter)

<div class="govuk-grid-row"> <div class="govuk-grid-column-full"> <!-- Full width content --> </div> </div> <div class="govuk-grid-row"> <div class="govuk-grid-column-two-thirds"> <!-- Main content area --> </div> <div class="govuk-grid-column-one-third"> <!-- Sidebar content --> </div> </div> <div class="govuk-grid-row"> <div class="govuk-grid-column-one-half"> <!-- Left half --> </div> <div class="govuk-grid-column-one-half"> <!-- Right half --> </div> </div>

📏 Spacing

Consistent spacing system based on GOV.UK Design System.

Margin Classes

govuk-!-margin-0
govuk-!-margin-2
govuk-!-margin-4
govuk-!-margin-6

Padding Classes

govuk-!-padding-2
govuk-!-padding-4
govuk-!-padding-6
govuk-!-padding-8

Spacing Scale

Class Size Usage Example
govuk-!-margin-0 0px Remove spacing
govuk-!-margin-1 5px Minimal spacing
govuk-!-margin-2 10px Small spacing
govuk-!-margin-4 20px Standard spacing
govuk-!-margin-6 30px Large spacing
<!-- Margin utility classes --> <div class="govuk-!-margin-0">No margin</div> <div class="govuk-!-margin-2">Small margin</div> <div class="govuk-!-margin-4">Standard margin</div> <div class="govuk-!-margin-6">Large margin</div> <!-- Padding utility classes --> <div class="govuk-!-padding-2">Small padding</div> <div class="govuk-!-padding-4">Standard padding</div> <div class="govuk-!-padding-6">Large padding</div> <!-- Directional spacing --> <div class="govuk-!-margin-top-4">Top margin only</div> <div class="govuk-!-padding-left-2">Left padding only</div>

🖱️ Buttons

All button variants using your color palette.

Primary Buttons

Custom Color Buttons

<!-- Standard GOV.UK Buttons --> <button class="govuk-button" data-module="govuk-button"> Primary Button </button> <button class="govuk-button govuk-button--secondary"> Secondary Button </button> <!-- Custom Color Buttons --> <button class="govuk-button custom-button-3">Tertiary</button> <button class="govuk-button custom-button-4">Accent</button>

📝 Forms

Form components with proper validation states and accessibility.

Text Inputs

We'll only use this to contact you about your application
Include country code

Error: Enter a valid phone number

Select & Radios

How do you want to be contacted?

Checkboxes & Textarea

Which types of waste do you transport?
Do not include personal or financial information, like your National Insurance number or credit card details.
Cancel
<!-- Text input with label and hint --> <div class="govuk-form-group"> <label class="govuk-label" for="input-example">Label text</label> <div class="govuk-hint" id="input-hint">Hint text</div> <input class="govuk-input" id="input-example" name="input-example" type="text" aria-describedby="input-hint"> </div> <!-- Error state --> <div class="govuk-form-group govuk-form-group--error"> <label class="govuk-label" for="input-error">Label text</label> <p class="govuk-error-message" id="input-error-message"> <span class="govuk-visually-hidden">Error:</span> Error message </p> <input class="govuk-input govuk-input--error" id="input-error" name="input-error" type="text" aria-describedby="input-error-message"> </div> <!-- Radios --> <div class="govuk-form-group"> <fieldset class="govuk-fieldset"> <legend class="govuk-fieldset__legend">Legend text</legend> <div class="govuk-radios"> <div class="govuk-radios__item"> <input class="govuk-radios__input" id="radio-1" name="radio-group" type="radio" value="option1"> <label class="govuk-label govuk-radios__label" for="radio-1">Option 1</label> </div> </div> </fieldset> </div>

🔘 Radio Buttons

Radio buttons let users select one option from a list. Use radio buttons when users can only choose one option from a list of fewer than 5 options.

Basic Radio Buttons

How would you prefer to be contacted?

Radio Buttons with Hints

What is your nationality?

If you have dual nationality, select all that apply.
Including English, Scottish, Welsh and Northern Irish

Radio Buttons with Error State

How would you prefer to be contacted?

Error: Select how you would prefer to be contacted

Inline Radio Buttons

Did you live in the UK between 2018 and 2019?

Custom Styled Radio Buttons

Choose your priority level

Basic Radio Buttons HTML: <div class="govuk-form-group"> <fieldset class="govuk-fieldset"> <legend class="govuk-fieldset__legend govuk-fieldset__legend--m"> <h4 class="govuk-fieldset__heading">How would you prefer to be contacted?</h4> </legend> <div class="govuk-radios" data-module="govuk-radios"> <div class="govuk-radios__item"> <input class="govuk-radios__input" id="contact-email" name="contact" type="radio" value="email"> <label class="govuk-label govuk-radios__label" for="contact-email">Email</label> </div> <div class="govuk-radios__item"> <input class="govuk-radios__input" id="contact-phone" name="contact" type="radio" value="phone"> <label class="govuk-label govuk-radios__label" for="contact-phone">Phone</label> </div> </div> </fieldset> </div> Accessibility Considerations: • Always use fieldset and legend for radio button groups • Ensure all radio buttons have unique IDs and proper labels • Use aria-describedby for error messages and hints • Group related radio buttons with the same name attribute • Use meaningful values that can be processed on the server

☑️ Checkboxes

Checkboxes let users select one or more options from a list. Use checkboxes when users can select multiple options.

Basic Checkboxes

Which types of waste do you transport?

Select all that apply.

Checkboxes with Hints

Which services do you need?

One-on-one advisory session with our experts
Group workshops and skill development sessions
Email and phone support for 12 months
Specify any other services you need

Checkboxes with Error State

What is your nationality?

If you have dual nationality, select all that apply.

Error: Select your nationality

Small Checkboxes

Organisation setup

Custom Styled Checkboxes

Select your preferences

Exclusive Checkboxes

Will you be travelling to any of these countries?

or
Basic Checkboxes HTML: <div class="govuk-form-group"> <fieldset class="govuk-fieldset"> <legend class="govuk-fieldset__legend govuk-fieldset__legend--m"> <h4 class="govuk-fieldset__heading">Which types of waste do you transport?</h4> </legend> <div class="govuk-hint">Select all that apply.</div> <div class="govuk-checkboxes" data-module="govuk-checkboxes"> <div class="govuk-checkboxes__item"> <input class="govuk-checkboxes__input" id="waste-animal" name="waste" type="checkbox" value="animal"> <label class="govuk-label govuk-checkboxes__label" for="waste-animal">Waste from animal carcasses</label> </div> <div class="govuk-checkboxes__item"> <input class="govuk-checkboxes__input" id="waste-mines" name="waste" type="checkbox" value="mines"> <label class="govuk-label govuk-checkboxes__label" for="waste-mines">Waste from mines or quarries</label> </div> </div> </fieldset> </div> Accessibility Considerations: • Always use fieldset and legend for checkbox groups • Ensure all checkboxes have unique IDs and proper labels • Use aria-describedby for error messages and hints • Use data-behaviour="exclusive" for mutually exclusive options • Provide clear hint text when multiple selections are allowed • Use the govuk-checkboxes--small modifier for compact layouts

📅 Date Input

Use the date input component to help users enter a memorable date or one they can easily look up.

Basic Date Input

What is your date of birth?

For example, 27 3 1985

Date Input with Error

When was your passport issued?

For example, 12 11 2007

Error: The date your passport was issued must be in the past

Date Input with Partial Error

When did the event take place?

For example, 12 11 2007. If you do not know the exact date, give an approximate date.

Error: Date must include a month and year

Date Input for Memorable Dates

What is your wedding anniversary?

This will help us send you anniversary offers

Date Input for Recent Dates

When did you last make a payment?

This helps us identify your account. For example, 3 11 2023

Optional Date Input

When did your employment end? (optional)

Leave this blank if you are still employed. For example, 3 11 2023
Basic Date Input HTML: <div class="govuk-form-group"> <fieldset class="govuk-fieldset" role="group" aria-describedby="dob-hint"> <legend class="govuk-fieldset__legend govuk-fieldset__legend--l"> <h4 class="govuk-fieldset__heading">What is your date of birth?</h4> </legend> <div id="dob-hint" class="govuk-hint">For example, 27 3 1985</div> <div class="govuk-date-input" id="dob"> <div class="govuk-date-input__item"> <div class="govuk-form-group"> <label class="govuk-label govuk-date-input__label" for="dob-day">Day</label> <input class="govuk-input govuk-date-input__input govuk-input--width-2" id="dob-day" name="dob-day" type="text" inputmode="numeric"> </div> </div> <div class="govuk-date-input__item"> <div class="govuk-form-group"> <label class="govuk-label govuk-date-input__label" for="dob-month">Month</label> <input class="govuk-input govuk-date-input__input govuk-input--width-2" id="dob-month" name="dob-month" type="text" inputmode="numeric"> </div> </div> <div class="govuk-date-input__item"> <div class="govuk-form-group"> <label class="govuk-label govuk-date-input__label" for="dob-year">Year</label> <input class="govuk-input govuk-date-input__input govuk-input--width-4" id="dob-year" name="dob-year" type="text" inputmode="numeric"> </div> </div> </div> </fieldset> </div> When to Use Date Input: • For memorable dates (birth dates, anniversaries) • When users need to look up dates from documents • For approximate dates where exact precision isn't required • Avoid for calendar-based selections or complex date ranges Accessibility Considerations: • Always use fieldset and legend to group date inputs • Use inputmode="numeric" for better mobile keyboards • Provide clear hint text with format examples • Use role="group" on fieldset for screen readers • For errors, mark only the incorrect fields with govuk-input--error • Include aria-describedby for hints and error messages

📎 File Upload

Help users select and upload files from their device.

Basic File Upload

File Upload with Hint

Your CV must be in DOC, DOCX or PDF format and smaller than 2MB

File Upload with Error

Your photo must be at least 600x750 pixels

Error: The selected file must be a JPG, BMP, PNG, TIF or PDF

Multiple File Upload

You can select multiple files at once

Custom Styled File Upload

Upload receipts, invoices, or other supporting documents
Basic File Upload HTML: <div class="govuk-form-group"> <label class="govuk-label" for="file-upload-1"> Upload a file </label> <input class="govuk-file-upload" id="file-upload-1" name="file-upload-1" type="file"> </div> File Upload with Accept Attribute: <input class="govuk-file-upload" id="file-upload" name="file-upload" type="file" accept=".doc,.docx,.pdf" aria-describedby="file-upload-hint"> Accessibility Considerations: • Always provide a clear label describing what to upload • Use hint text to specify file types and size limits • Use the accept attribute to limit file types • Use aria-describedby to link hints and error messages • Test with assistive technologies

🔢 Character Count

Help users know how much content they can enter when there is a limit on the number of characters.

Basic Character Count

Do not include personal or financial information, like your National Insurance number or credit card details.
You can enter up to 200 characters

Character Count with Error

Include time, location, and people involved

Error: Description must be 250 characters or less

You have 78 characters too many

Word Count

Summarize the main points in no more than 150 words
You can enter up to 150 words

Character Count for Input Fields

Keep it short and engaging
You can enter up to 280 characters
Character Count HTML: <div class="govuk-form-group"> <label class="govuk-label" for="with-hint"> Can you provide more detail? </label> <div class="govuk-character-count" data-module="govuk-character-count" data-maxlength="200"> <textarea class="govuk-textarea govuk-character-count__textarea" id="with-hint" name="with-hint" rows="5" aria-describedby="with-hint-info"></textarea> <div id="with-hint-info" class="govuk-hint govuk-character-count__message"> You can enter up to 200 characters </div> </div> </div> Word Count HTML: <div class="govuk-character-count" data-module="govuk-character-count" data-maxwords="150"> <textarea class="govuk-textarea govuk-character-count__textarea" id="word-count" name="word-count" rows="5"></textarea> <div class="govuk-hint govuk-character-count__message"> You can enter up to 150 words </div> </div> Accessibility Considerations: • Use data-maxlength for character counting • Use data-maxwords for word counting • Include aria-describedby to link the counter message • Messages update in real-time as users type • Works with both textarea and input elements

📋 Summary List

Use the summary list to summarise information, for example, a user's responses at the end of a form.

Basic Summary List

Name
Sarah Philips
Date of birth
5 January 1978
Address
72 Guild Street
London
SE23 6FH
Contact details

07700 900457

sarah.phillips@example.com

Summary List with Actions

Application type
Standard application
Change application type
Priority level
High priority
Change priority level
Supporting documents
  • Passport copy
  • Bank statement
  • Utility bill
Add supporting documents
Basic Summary List HTML: <dl class="govuk-summary-list"> <div class="govuk-summary-list__row"> <dt class="govuk-summary-list__key">Name</dt> <dd class="govuk-summary-list__value">Sarah Philips</dd> </div> <div class="govuk-summary-list__row"> <dt class="govuk-summary-list__key">Date of birth</dt> <dd class="govuk-summary-list__value">5 January 1978</dd> </div> </dl> Summary List with Actions: <dl class="govuk-summary-list"> <div class="govuk-summary-list__row"> <dt class="govuk-summary-list__key">Name</dt> <dd class="govuk-summary-list__value">Sarah Philips</dd> <dd class="govuk-summary-list__actions"> <a class="govuk-link" href="#">Change<span class="govuk-visually-hidden"> name</span></a> </dd> </div> </dl>

New Semantic Badges

Status indicators using your full color palette.

All Badge Colors

Primary Badge Secondary Badge Tertiary Badge Accent Badge Warning Badge

Usage Examples

12 pending tasks in your queue

Status: Approved

Priority: High

<span class="custom-badge custom-badge--primary">Primary Badge</span> <span class="custom-badge custom-badge--secondary">Secondary Badge</span> <span class="custom-badge custom-badge--tertiary">Tertiary Badge</span> <span class="custom-badge custom-badge--accent">Accent Badge</span> <span class="custom-badge custom-badge--warning">Warning Badge</span>

🖼️ Panels

Panel components for highlighting important content and organizing information.

Confirmation Panels

Application complete

Your reference number
HDJ2123F

Custom Colored Panels

Secondary Panel

Using secondary purple
Color #5445d9

Accent Panel

Using accent pink
Color #a82d7d

Information Panels

It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.

Warning You can be fined up to £5,000 if you do not register.
<!-- Confirmation panel --> <div class="govuk-panel govuk-panel--confirmation"> <h1 class="govuk-panel__title">Application complete</h1> <div class="govuk-panel__body"> Your reference number<br><strong>HDJ2123F</strong> </div> </div> <!-- Custom colored panel --> <div class="govuk-panel" style="background-color: var(--color-2); border-color: var(--color-2);"> <h2 class="govuk-panel__title" style="color: white;">Custom Panel</h2> <div class="govuk-panel__body" style="color: white;"> Custom content with colored background </div> </div> <!-- Inset text --> <div class="govuk-inset-text"> <p class="govuk-body">Important information in a highlighted box.</p> </div> <!-- Warning text --> <div class="govuk-warning-text"> <span class="govuk-warning-text__icon" aria-hidden="true">!</span> <strong class="govuk-warning-text__text"> <span class="govuk-warning-text__assistive">Warning</span> Warning message text </strong> </div>

Info Boxes

Colored accent boxes for organizing content.

Primary Info Box

Uses your primary blue color for the accent border.

Secondary Info Box

Uses your secondary purple color for visual variety.

Tertiary Info Box

Uses your tertiary magenta for special content.

<div class="info-box info-box--primary"> <h3 class="govuk-heading-m">Title</h3> <p class="govuk-body">Content</p> <button class="govuk-button custom-button-1">Action</button> </div>

📖 Details & Accordions

Expandable content sections for progressive disclosure and better user experience.

Details Components

What is a National Insurance number?

A National Insurance number is a unique identifier used by the UK government to track your National Insurance contributions and entitlements.

It's made up of 2 letters, 6 numbers and 1 letter, for example QQ 12 34 56 C.

Find your National Insurance number if you've lost it.

How much does it cost to apply?

The application fee is £154 for most applications.

  • Standard application: £154
  • Priority service (expedited): £225
  • Premium service (super priority): £375

You may be eligible for a fee reduction or exemption in certain circumstances.

Accordion (Multiple Details)

Understanding your color palette

Your color palette consists of 5 carefully chosen colors that meet WCAG accessibility standards:

  • Primary Magenta - Main brand color
  • Secondary Purple - Supporting color
  • Tertiary Blue - Accent color
  • Accent Pink - Highlight color
  • Warning Coral - Alert color

Accessibility compliance

All colors in this palette have been tested for accessibility:

  • Minimum contrast ratio of 4.5:1 (WCAG AA)
  • Most colors exceed 7:1 contrast ratio (WCAG AAA)
  • Tested with screen readers and keyboard navigation
  • Color-blind friendly combinations

View detailed accessibility information

Implementation guidance

Use CSS custom properties for consistent color application:

:root { --primary: #7130a6; --secondary: #5445d9; --tertiary: #3D6DDB; --accent: #a82d7d; --warning: #b83241; } .my-component { background-color: var(--primary); color: white; }

View full implementation guide

<!-- Simple details component --> <details class="govuk-details" data-module="govuk-details"> <summary class="govuk-details__summary"> <span class="govuk-details__summary-text">Summary text</span> </summary> <div class="govuk-details__text"> <p class="govuk-body">Detailed content that is hidden by default.</p> </div> </details> <!-- Accordion component --> <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-example"> <div class="govuk-accordion__section"> <div class="govuk-accordion__section-header"> <h2 class="govuk-accordion__section-heading"> <span class="govuk-accordion__section-button" id="accordion-heading-1"> Section title </span> </h2> </div> <div id="accordion-content-1" class="govuk-accordion__section-content"> <p class="govuk-body">Section content</p> </div> </div> </div>

🚧 Phase Banner

Phase banners to communicate the development status of your service.

Standard Phase Banners

This is a new service – your feedback will help us to improve it.

This is a new service – your feedback will help us to improve it.

Custom Phase Banners

Development This service is in active development. Features may change without notice.

Preview Preview version - switch to live service for official use.

Maintenance Some features may be temporarily unavailable during scheduled maintenance.

<!-- Standard phase banner --> <div class="govuk-phase-banner"> <p class="govuk-phase-banner__content"> <strong class="govuk-tag govuk-phase-banner__content__tag">Beta</strong> <span class="govuk-phase-banner__text"> This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it. </span> </p> </div> <!-- Custom colored phase banner --> <div class="govuk-phase-banner"> <p class="govuk-phase-banner__content"> <strong class="govuk-tag" style="background-color: var(--color-2); color: white;">Custom</strong> <span class="govuk-phase-banner__text"> Custom phase banner with themed colors. </span> </p> </div>

Notifications & Banners

Important

Standard notification banner using primary blue

This is a standard notification with a link.

Success

Success notification with green theme

Your action was completed successfully with a confirmation link.

Important

Accent Pink notification banner

This is the new accent pink variant with a themed link.

<!-- Standard notification --> <div class="govuk-notification-banner" role="region"> <div class="govuk-notification-banner__header"> <h2 class="govuk-notification-banner__title">Important</h2> </div> <div class="govuk-notification-banner__content"> <p class="govuk-notification-banner__heading">Title</p> <p class="govuk-body">Content</p> </div> </div> <!-- NEW: Accent Pink variant --> <div class="govuk-notification-banner govuk-notification-banner--accent-pink"> <!-- Same structure as above --> </div>

Tables

Color Usage Statistics
Color Hex Code Usage Contrast Ratio Status
Primary Magenta #7130a6 Buttons, Links 7.85:1 WCAG AAA
Secondary Purple #5445d9 Secondary Actions 6.50:1 WCAG AA
Tertiary Blue #3D6DDB Special Content 4.76:1 WCAG AA
Accent Pink #a82d7d Focus States 6.29:1 WCAG AA
Warning Coral #b83241 Warnings, Alerts 5.88:1 WCAG AA
<table class="govuk-table"> <caption class="govuk-table__caption govuk-table__caption--m"> Color Usage Statistics </caption> <thead class="govuk-table__head"> <tr class="govuk-table__row"> <th scope="col" class="govuk-table__header">Color</th> <th scope="col" class="govuk-table__header">Usage</th> </tr> </thead> <tbody class="govuk-table__body"> <tr class="govuk-table__row"> <td class="govuk-table__cell">Primary Blue</td> <td class="govuk-table__cell">Buttons, Links</td> </tr> </tbody> </table>

Utility Classes

Ready-to-use classes for applying your color palette.

Background Colors

bg-color-1
bg-color-2
bg-color-3
bg-color-4
bg-color-5

Text Colors

Text in color 1

Text in color 2

Text in color 3

Text in color 4

Text in color 5

<!-- Background utility classes --> <div class="bg-color-1">Blue background with white text</div> <div class="bg-color-2">Purple background with white text</div> <div class="bg-color-3">Magenta background with white text</div> <div class="bg-color-4">Pink background with white text</div> <div class="bg-color-5">Coral background with white text</div> <!-- Text color utility classes --> <p class="text-color-1">Blue text</p> <p class="text-color-2">Purple text</p> <p class="text-color-3">Magenta text</p> <p class="text-color-4">Pink text</p> <p class="text-color-5">Coral text</p> <!-- Border utility classes --> <div class="border-color-1" style="border: 2px solid;">Blue border</div>

Accessibility Features

WCAG 2.1 Compliance

All color combinations in this palette meet or exceed WCAG 2.1 AA standards:

  • Level AA: Minimum contrast ratio of 4.5:1 for normal text
  • Level AAA: Enhanced contrast ratio of 7:1 for superior accessibility
  • Focus states: 3px solid outline using accent pink for visibility
  • Keyboard navigation: All interactive elements are keyboard accessible
  • Screen readers: Proper semantic markup and ARIA labels

Testing Your Implementation

To ensure accessibility in your projects:

  1. Test with keyboard navigation (Tab, Enter, Escape, arrow keys)
  2. Verify with screen readers (NVDA, JAWS, VoiceOver)
  3. Check color contrast with automated tools
  4. Test with users who have disabilities
  5. Validate HTML for semantic correctness
Accessibility Features

All components include:

  • Keyboard navigation support
  • Screen reader compatibility
  • High contrast mode support
  • Reduced motion preferences
<!-- Accessible button with proper focus --> <button class="govuk-button" data-module="govuk-button"> Accessible Button </button> <!-- Accessible link with descriptive text --> <a href="#" class="govuk-link"> Download user guide (PDF, 2.1MB) </a> <!-- Accessible form with proper labels --> <div class="govuk-form-group"> <label class="govuk-label" for="email">Email address</label> <input class="govuk-input" id="email" type="email"> </div>

✅ Task List

Help users understand what they need to do to complete a process and track their progress.

Basic Task List

  1. Contact details
    Cannot start yet
  2. Upload documents
    Cannot start yet
Task List HTML: <ol class="govuk-task-list"> <li class="govuk-task-list__item govuk-task-list__item--with-link"> <div class="govuk-task-list__name-and-hint"> <a class="govuk-link govuk-task-list__link" href="#" aria-describedby="task-completed"> Check eligibility </a> </div> <div class="govuk-task-list__status" id="task-completed"> <strong class="govuk-tag govuk-tag--blue">Completed</strong> </div> </li> </ol>

⚠️ Warning Text & Inset Text

Use warning text and inset text to help users understand important information.

Warning Text

Warning You can be fined up to £5,000 if you do not register.

Inset Text

It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.

Styled Variations

Warning This action cannot be undone.
Important: Your application will be automatically saved every 5 minutes.
Tip: You can come back and complete this form later.
Warning Text HTML: <div class="govuk-warning-text"> <span class="govuk-warning-text__icon" aria-hidden="true">!</span> <strong class="govuk-warning-text__text"> <span class="govuk-warning-text__assistive">Warning</span> You can be fined up to £5,000 if you do not register. </strong> </div> Inset Text HTML: <div class="govuk-inset-text"> It can take up to 8 weeks to register a lasting power of attorney. </div>

❌ Error Messages

Help users understand what went wrong and how to fix it.

Individual Error Messages

Error: Enter an email address in the correct format, like name@example.com

Error: Enter a telephone number, like 01632 960 001 or 07700 900 982

Error: The date must be in the past

Error Summary HTML: <div class="govuk-error-summary" data-module="govuk-error-summary"> <div role="alert"> <h2 class="govuk-error-summary__title">There is a problem</h2> <div class="govuk-error-summary__body"> <ul class="govuk-list govuk-error-summary__list"> <li><a href="#email-error">Enter an email address</a></li> </ul> </div> </div> </div> Individual Error Message HTML: <p id="email-error" class="govuk-error-message"> <span class="govuk-visually-hidden">Error:</span> Enter an email address </p>

⚙️ Implementation Guide

Complete guide to implementing this design system in your projects.

Getting Started

Follow these steps to implement the design system in your project:

  1. Step 1 Include GOV.UK Frontend

    Add the GOV.UK Frontend CSS and JavaScript to your project:

    <!-- In your HTML head --> <link rel="stylesheet" href="govuk-frontend.min.css"> <link rel="stylesheet" href="main.css"> <!-- Before closing body tag --> <script src="govuk-frontend.min.js"></script> <script> if(window.GOVUKFrontend) { window.GOVUKFrontend.initAll(); } </script>
  2. Step 2 Add Color Variables

    Define the color palette in your CSS:

    /* Color Palette Variables */ :root { /* Primary Colors */ --color-1: #7130a6; /* Primary Magenta */ --color-2: #5445d9; /* Secondary Purple */ --color-3: #3D6DDB; /* Tertiary Blue */ --color-4: #a82d7d; /* Accent Pink */ --color-5: #b83241; /* Warning Coral */ /* Semantic Aliases */ --primary: var(--color-1); --secondary: var(--color-2); --tertiary: var(--color-3); --accent: var(--color-4); --warning: var(--color-5); /* Text Colors */ --color-1-text: #ffffff; --color-2-text: #ffffff; --color-3-text: #ffffff; --color-4-text: #ffffff; --color-5-text: #ffffff; }
  3. Step 3 Implement Utility Classes

    Add utility classes for quick styling:

    /* Background Color Utilities */ .bg-color-1 { background-color: var(--color-1); color: var(--color-1-text); } .bg-color-2 { background-color: var(--color-2); color: var(--color-2-text); } .bg-color-3 { background-color: var(--color-3); color: var(--color-3-text); } .bg-color-4 { background-color: var(--color-4); color: var(--color-4-text); } .bg-color-5 { background-color: var(--color-5); color: var(--color-5-text); } /* Text Color Utilities */ .text-color-1 { color: var(--color-1); } .text-color-2 { color: var(--color-2); } .text-color-3 { color: var(--color-3); } .text-color-4 { color: var(--color-4); } .text-color-5 { color: var(--color-5); } /* Border Utilities */ .border-color-1 { border-color: var(--color-1); } .border-color-2 { border-color: var(--color-2); } .border-color-3 { border-color: var(--color-3); } .border-color-4 { border-color: var(--color-4); } .border-color-5 { border-color: var(--color-5); }

Component Customization

Custom Buttons

/* Custom Button Styles */ .custom-button-1 { background-color: var(--color-1) !important; color: var(--color-1-text) !important; box-shadow: 0 2px 0 var(--color-1-dark) !important; } .custom-button-2 { background-color: var(--color-2) !important; color: var(--color-2-text) !important; box-shadow: 0 2px 0 var(--color-2-dark) !important; }

Custom Badges

/* Custom Badge Styles */ .custom-badge { display: inline-block; padding: 4px 8px; font-size: 0.875rem; font-weight: bold; border-radius: 4px; text-decoration: none; } .custom-badge--primary { background-color: var(--color-1); color: var(--color-1-text); }

Best Practices

Important Always test color combinations for accessibility compliance before deploying.

Development Guidelines

  • Use semantic color names (primary, secondary) rather than descriptive names (blue, purple)
  • Test all interactive elements with keyboard navigation
  • Verify color contrast ratios meet WCAG 2.1 AA standards (4.5:1 minimum)
  • Use CSS custom properties for maintainable color management
  • Document color usage and meaning for your team
  • Test with screen readers and assistive technologies

Quick Reference

Use these classes for rapid prototyping:

  • .bg-color-1 to .bg-color-5 for backgrounds
  • .text-color-1 to .text-color-5 for text
  • .custom-badge--primary etc. for status indicators
  • .custom-button-1 etc. for themed buttons

Integration Examples

HTML Integration Example
<!DOCTYPE html> <html lang="en" class="govuk-template"> <head> <meta charset="utf-8"> <title>My Elecura Service</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="govuk-frontend.min.css"> <link rel="stylesheet" href="main.css"> </head> <body class="govuk-template__body"> <div class="govuk-width-container"> <main class="govuk-main-wrapper"> <h1 class="govuk-heading-xl">My Service</h1> <button class="govuk-button custom-button-1">Primary Action</button> <p class="govuk-body"> Status: <span class="custom-badge custom-badge--primary">Active</span> </p> </main> </div> <script src="govuk-frontend.min.js"></script> <script>window.GOVUKFrontend && window.GOVUKFrontend.initAll();</script> </body> </html>
CSS Architecture
/* main.css - Your custom styles */ /* 1. Color Variables */ :root { --color-1: #7130a6; --color-2: #5445d9; --color-3: #3D6DDB; --color-4: #a82d7d; --color-5: #b83241; } /* 2. Utility Classes */ .bg-color-1 { background-color: var(--color-1); color: #fff; } /* ... more utilities ... */ /* 3. Component Extensions */ .custom-button-1 { background-color: var(--color-1) !important; color: #fff !important; } /* 4. Custom Components */ .info-box { background: white; border-radius: 8px; padding: 20px; border-left: 5px solid; } .info-box--primary { border-left-color: var(--color-1); }
JavaScript Enhancement
// Optional JavaScript enhancements // Color picker functionality function copyColor(color) { navigator.clipboard.writeText(color).then(function() { showNotification('Color copied: ' + color); }); } // Dynamic theme switching function switchTheme(themeName) { document.documentElement.setAttribute('data-theme', themeName); localStorage.setItem('preferred-theme', themeName); } // Initialize GOV.UK Frontend if (window.GOVUKFrontend) { window.GOVUKFrontend.initAll(); }

🔍 Conditional Reveals

Forms that show or hide content based on user selections, enhancing usability by reducing cognitive load.

Radio Button Conditional Reveal

How would you prefer to be contacted?

Checkbox Conditional Reveal

Which types of waste do you transport?

<div class="govuk-radios" data-module="govuk-radios"> <div class="govuk-radios__item"> <input class="govuk-radios__input" id="contact-email" name="contact" type="radio" value="email" data-aria-controls="conditional-email"> <label class="govuk-label govuk-radios__label" for="contact-email">Email</label> </div> <div class="govuk-radios__conditional govuk-radios__conditional--hidden" id="conditional-email"> <div class="govuk-form-group"> <input class="govuk-input" type="email" name="email-address"> </div> </div> </div>

Accessibility Considerations

  • Uses data-aria-controls to link controls to conditional content
  • Content is hidden with govuk-radios__conditional--hidden class
  • Screen readers are informed when content is revealed or hidden
  • JavaScript enhancement is progressive - forms work without JS

📄 Pagination

Navigation between pages of content, helping users understand where they are in a sequence.

Pagination with Ellipsis

Colored Pagination Examples

<nav class="govuk-pagination" role="navigation" aria-label="Pagination"> <div class="govuk-pagination__prev"> <a class="govuk-link govuk-pagination__link" href="#" rel="prev"> <span class="govuk-pagination__link-title">Previous</span> </a> </div> <ul class="govuk-pagination__list"> <li class="govuk-pagination__item govuk-pagination__item--current"> <a class="govuk-link govuk-pagination__link" href="#" aria-current="page">1</a> </li> <li class="govuk-pagination__item"> <a class="govuk-link govuk-pagination__link" href="#">2</a> </li> </ul> <div class="govuk-pagination__next"> <a class="govuk-link govuk-pagination__link" href="#" rel="next"> <span class="govuk-pagination__link-title">Next</span> </a> </div> </nav>

📋 Fieldset & Legend

Enhanced form grouping that provides semantic structure and improved accessibility for related form controls.

Large Legend Example

What is your address?

We'll only use this to send you important updates about your application.

Medium Legend with Radio Buttons

What is your nationality?

If you have dual nationality, select all options that are relevant to you.

Colored Fieldset Examples

Primary Information

Secondary Details

<fieldset class="govuk-fieldset" role="group" aria-describedby="hint-id"> <legend class="govuk-fieldset__legend govuk-fieldset__legend--l"> <h2 class="govuk-fieldset__heading">What is your address?</h2> </legend> <div id="hint-id" class="govuk-hint"> We'll only use this to send you updates. </div> <div class="govuk-form-group"> <label class="govuk-label" for="address-line-1">Building and street</label> <input class="govuk-input" id="address-line-1" name="address-line-1" type="text" autocomplete="address-line1"> </div> </fieldset>

Legend Sizes

  • govuk-fieldset__legend--xl - Extra large (48px)
  • govuk-fieldset__legend--l - Large (36px)
  • govuk-fieldset__legend--m - Medium (24px)
  • govuk-fieldset__legend--s - Small (19px)

Accessibility Best Practices

  • Use role="group" for complex fieldsets
  • Associate hint text with aria-describedby
  • Ensure legend clearly describes the group purpose
  • Use appropriate heading levels within legends

🚨 Exit This Page

Emergency exit component for sensitive services, allowing users to quickly leave the page for safety reasons.

Standard Exit This Page

Keyboard shortcut: Press Shift three times to exit

Custom Colored Exit Buttons

Emergency Exit
Coral warning style
Quick Exit
Pink accent style
Leave Now
Primary magenta style

Exit This Page with Instructions

Warning If you need to leave this page quickly for your safety, use the emergency exit button below or press Shift 3 times.
How the emergency exit works
  • Takes you to BBC Weather (a commonly visited, safe website)
  • Clears your browser history for this page
  • Works with keyboard shortcut: Shift pressed 3 times quickly
  • Cannot be accidentally activated
<div class="govuk-exit-this-page" data-module="govuk-exit-this-page"> <a href="https://www.bbc.co.uk/weather" role="button" draggable="false" class="govuk-button govuk-button--warning govuk-exit-this-page__button" data-module="govuk-button"> <span class="govuk-visually-hidden">Emergency</span>Exit this page </a> </div> <!-- Include warning text above the button --> <div class="govuk-warning-text"> <span class="govuk-warning-text__icon" aria-hidden="true">!</span> <strong class="govuk-warning-text__text"> If you need to leave quickly, press Shift 3 times or use the exit button. </strong> </div>

When to Use

  • Services dealing with domestic violence or abuse
  • Mental health and crisis support services
  • Any service where users might need to leave quickly for safety
  • Services handling sensitive personal information

Implementation Notes

  • Default destination is BBC Weather (trusted, commonly visited)
  • Keyboard shortcut: Shift key pressed 3 times quickly
  • Clears browser history and session data
  • Should be prominently placed and consistently available
  • Test with actual users in vulnerable situations

🚀 Start Page Pattern

Service start pages that introduce users to your service and help them understand what they need to do.

Complete Start Page Example

Apply for a licence to import controlled goods

Use this service to apply for a licence to import controlled goods into the UK.

You can use this service to:

  • apply for a new import licence
  • renew an existing licence
  • check the status of your application
Warning You can be fined up to £5,000 if you import controlled goods without a licence.

Before you start

You'll need:

  • your company registration number
  • details of the goods you want to import
  • your import licence number (if renewing)
  • a debit or credit card to pay the £123 application fee

The application takes around 15 minutes to complete.

Start now

Other ways to apply

You can also apply by post. Send your completed application form to:

Import Licensing Team
Department for International Trade
3 Whitehall Place
London SW1A 2AW

Start Button Variations

Start now
Primary Magenta
Begin application
Secondary Purple
Continue
Tertiary Blue
<h1 class="govuk-heading-xl">Apply for a licence</h1> <p class="govuk-body-l">Use this service to apply for a licence.</p> <h2 class="govuk-heading-m">Before you start</h2> <p class="govuk-body">You'll need:</p> <ul class="govuk-list govuk-list--bullet"> <li>your company registration number</li> <li>a debit or credit card</li> </ul> <a href="#" role="button" class="govuk-button govuk-button--start" data-module="govuk-button"> Start now <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true"> <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"/> </svg> </a>

Start Page Elements

  • Service name: Clear, descriptive heading
  • Service description: What the service does in plain English
  • Before you start: What users need to complete the service
  • Start button: Clear call-to-action with arrow icon
  • Alternative channels: Other ways to complete the task
  • Related content: Links to relevant information

Content Guidelines

  • Use active voice and plain English
  • Include estimated completion time
  • List all required information upfront
  • Mention any fees clearly
  • Include warnings about penalties if relevant

✅ Success Messages

Different patterns for showing successful completion of tasks and positive feedback to users.

Panel Success Message

Application complete

Your reference number
HDJ2123F

We have sent you a confirmation email.

What happens next

We've sent your application to Hackney Electoral Register Office.

They will contact you either to confirm your registration, or to ask for more information.

Colored Success Panels

Registration successful

Reference
REF001

Payment confirmed

Transaction ID
TXN456

Booking complete

Booking number
BK789

Notification Banner Success

Inline Success Messages

✓ Changes saved successfully

Your profile has been updated.

✓ Document uploaded

contract.pdf (2.3 MB)

✓ Email verified

You can now receive notifications.

Task List Success States

<!-- Panel Success Message --> <div class="govuk-panel govuk-panel--confirmation"> <h1 class="govuk-panel__title">Application complete</h1> <div class="govuk-panel__body"> Your reference number<br><strong>HDJ2123F</strong> </div> </div> <!-- Notification Banner Success --> <div class="govuk-notification-banner govuk-notification-banner--success" role="alert" data-module="govuk-notification-banner"> <div class="govuk-notification-banner__header"> <h2 class="govuk-notification-banner__title">Success</h2> </div> <div class="govuk-notification-banner__content"> <h3 class="govuk-notification-banner__heading"> You have successfully signed up to email alerts </h3> </div> </div>

When to Use Different Success Patterns

  • Panel: Major task completion (applications, submissions)
  • Notification banner: Page-level success messages
  • Inline messages: Form field or section-level success
  • Tags: Status indicators in lists or summaries

Content Guidelines

  • Use clear, descriptive headings that confirm the action
  • Include reference numbers for applications or transactions
  • Explain what happens next
  • Provide relevant follow-up actions or links
  • Use positive, reassuring language

📱 Header Variations

Different configurations of the GOV.UK header component to suit various service needs.

Header with Service Name

Colored Header Variations

<header class="govuk-header" role="banner" data-module="govuk-header"> <div class="govuk-header__container govuk-width-container"> <div class="govuk-header__logo"> <a href="#" class="govuk-header__link govuk-header__link--homepage"> <span class="govuk-header__logotype"> <span class="govuk-header__logotype-text">GOV.UK</span> </span> </a> </div> <div class="govuk-header__content"> <a href="#" class="govuk-header__link govuk-header__service-name"> Service name </a> </div> </div> </header>

⚡ JavaScript Patterns

Progressive enhancement patterns and JavaScript best practices for government services.

Progressive Enhancement Example

Character Counter with JavaScript Enhancement

Don't include personal or financial information, eg your National Insurance number or credit card details.

Dynamic Content Loading

Form Validation Enhancement

JavaScript Code Examples

// Progressive Enhancement Pattern document.addEventListener('DOMContentLoaded', function() { // Only enhance if JavaScript is available if (document.querySelector('[data-module="character-count"]')) { initCharacterCount(); } }); function initCharacterCount() { const textarea = document.getElementById('feedback-textarea'); const messageEl = document.querySelector('.character-count-message'); const remainingEl = document.querySelector('.character-count-remaining'); if (textarea && messageEl && remainingEl) { messageEl.style.display = 'block'; textarea.addEventListener('input', function() { const remaining = textarea.maxLength - textarea.value.length; remainingEl.textContent = remaining; if (remaining < 0) { messageEl.style.color = 'var(--color-5)'; textarea.classList.add('govuk-input--error'); } else { messageEl.style.color = ''; textarea.classList.remove('govuk-input--error'); } }); } } // Form Validation Enhancement function enhanceFormValidation(formId) { const form = document.getElementById(formId); if (!form) return; form.addEventListener('submit', function(e) { e.preventDefault(); const emailInput = form.querySelector('#email-input'); const phoneInput = form.querySelector('#phone-input'); let hasErrors = false; // Validate email if (!validateEmail(emailInput.value)) { showError('email-input', 'email-error'); hasErrors = true; } else { hideError('email-input', 'email-error'); } // Validate phone if (!phoneInput.value.trim()) { showError('phone-input', 'phone-error'); hasErrors = true; } else { hideError('phone-input', 'phone-error'); } if (!hasErrors) { // Submit form or show success message alert('Form submitted successfully!'); } }); } function validateEmail(email) { const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return re.test(email); } function showError(inputId, errorId) { const input = document.getElementById(inputId); const error = document.getElementById(errorId); input.classList.add('govuk-input--error'); error.style.display = 'block'; input.setAttribute('aria-describedby', errorId); } function hideError(inputId, errorId) { const input = document.getElementById(inputId); const error = document.getElementById(errorId); input.classList.remove('govuk-input--error'); error.style.display = 'none'; input.removeAttribute('aria-describedby'); } // Dynamic Content Loading function loadDynamicContent() { const button = event.target; const content = document.getElementById('dynamic-content'); const spinner = document.getElementById('loading-spinner'); button.disabled = true; spinner.style.display = 'block'; // Simulate API call setTimeout(() => { spinner.style.display = 'none'; content.style.display = 'block'; button.textContent = 'Information Loaded'; // Focus management for accessibility content.querySelector('h4').focus(); }, 1500); } // Initialize enhancements document.addEventListener('DOMContentLoaded', function() { enhanceFormValidation('enhanced-form'); });

Progressive Enhancement Principles

  • Start with HTML: Ensure basic functionality works without JavaScript
  • Layer on CSS: Add visual enhancements that improve usability
  • Enhance with JS: Add interactive features that improve user experience
  • Fail gracefully: Ensure the service works even if JavaScript fails
  • Test without JS: Regularly test with JavaScript disabled

Accessibility in JavaScript

  • Manage focus appropriately when content changes
  • Use ARIA attributes to communicate state changes
  • Provide alternative text for dynamic content
  • Ensure keyboard navigation works correctly
  • Test with screen readers

⚙️ Service Navigation

Complex navigation patterns for multi-service portals and large government organizations.

<nav class="service-navigation"> <div class="govuk-width-container"> <h2 class="govuk-heading-m">Available Services</h2> <ul class="service-navigation__list"> <li class="service-navigation__item"> <a href="#" class="service-navigation__link"> <h3>Apply for Benefits</h3> <p>Submit applications for government benefits</p> </a> </li> <li class="service-navigation__item"> <a href="#" class="service-navigation__link"> <h3>Tax Services</h3> <p>File tax returns and manage your tax affairs</p> </a> </li> </ul> </div> </nav>

🔧 Maintenance Page Pattern

Service unavailable messaging that keeps users informed during maintenance periods.

Standard Maintenance Page

Service temporarily unavailable

We're currently updating the service. You'll be able to use it again soon.

Scheduled maintenance:
Start: Today at 11:00pm
End: Tomorrow at 2:00am

What you can do

You can:

  • try again later
  • call us on 0300 123 4567 (Monday to Friday, 8am to 6pm)
  • use our alternative service for urgent requests
What we're updating
We're improving the service to make it:
  • faster and more reliable
  • easier to use on mobile devices
  • more accessible for users with disabilities

We apologise for any inconvenience.

Emergency Maintenance Banner

Colored Maintenance Themes

Planned Maintenance

Scheduled updates with advance notice

Duration: 3 hours

Emergency Maintenance

Urgent fixes with minimal notice

Status: In progress

Partial Outage

Some features affected

Impact: Limited functionality

<h1 class="govuk-heading-xl">Service temporarily unavailable</h1> <p class="govuk-body-l">We're currently updating the service.</p> <div class="govuk-inset-text"> <p><strong>Scheduled maintenance:</strong><br> Start: Today at 11:00pm<br> End: Tomorrow at 2:00am</p> </div> <h2 class="govuk-heading-m">What you can do</h2> <ul class="govuk-list govuk-list--bullet"> <li>try again later</li> <li>call us on 0300 123 4567</li> <li>use our <a href="#" class="govuk-link">alternative service</a></li> </ul>

Maintenance Page Best Practices

  • Clear messaging: Explain what's happening and why
  • Time estimates: Provide start and end times when possible
  • Alternative options: Offer other ways to complete tasks
  • Contact information: Include phone numbers or support links
  • Updates: Link to service status pages
  • Apology: Acknowledge the inconvenience caused

HTTP Status Codes

  • 503 Service Unavailable: For planned maintenance
  • 500 Internal Server Error: For unexpected issues
  • 200 OK with banner: For partial outages

📝 Inset Text

Highlighted text sections that draw attention to important information without using warning styles.

Standard Inset Text

It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.
You'll have a user ID if you've registered for Self Assessment or filed a tax return online before.

Colored Inset Text Examples

Primary Information: This is important information highlighted with our primary color.
Secondary Note: Additional context using our secondary color for distinction.
Process Information: Details about how the service works, highlighted in blue.
Special Notice: Important information that requires user attention.
<div class="govuk-inset-text"> It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application. </div> <!-- Colored variant --> <div class="govuk-inset-text" style="border-left-color: var(--color-1);"> Important information highlighted with custom color. </div>

When to Use Inset Text

  • To highlight important information that's not a warning
  • For process times or additional context
  • To break up long sections of text
  • For supplementary information users should know

When Not to Use

  • For warnings or error messages (use warning text instead)
  • For large amounts of text
  • Multiple times on the same page

💡 Hint Text

Helpful guidance text that appears below labels to assist users in completing form fields correctly.

Standard Hint Text

For example, 502135326
We'll only use this to contact you about your application

Colored Hint Text Examples

Must be between 3-20 characters, letters and numbers only
At least 8 characters with uppercase, lowercase and numbers
You can find this on your previous correspondence

Complex Hint Text

What is your date of birth?

For example, 27 3 1980
<div class="govuk-form-group"> <label class="govuk-label" for="passport-number">UK passport number</label> <div class="govuk-hint"> For example, 502135326 </div> <input class="govuk-input" id="passport-number" name="passport-number" type="text"> </div> <!-- Colored hint text --> <div class="govuk-hint" style="color: var(--color-1);"> Custom colored hint text for enhanced visual hierarchy </div>

Best Practices for Hint Text

  • Keep hints short and specific
  • Show examples of the format required
  • Explain why you need the information
  • Don't repeat the label text
  • Use plain English

Accessibility

  • Hint text is automatically associated with the input via aria-describedby
  • Screen readers announce the hint after the label
  • Ensure sufficient color contrast
  • Test with assistive technologies

⚠️ Form Validation

Comprehensive patterns for form validation, error handling, and user feedback.

Individual Field Errors

For example, 502135326

Error: Enter your passport number

Error: Enter a valid postcode

Colored Validation States

✓ Valid email format

⚠ Password is weak

ℹ Username available

Radio Button Group Error

How would you prefer to be contacted?

Select one option

Error: Select how you would prefer to be contacted

<!-- Error Summary --> <div class="govuk-error-summary" role="alert" data-module="govuk-error-summary"> <h2 class="govuk-error-summary__title">There is a problem</h2> <div class="govuk-error-summary__body"> <ul class="govuk-list govuk-error-summary__list"> <li><a href="#passport-number">Enter your passport number</a></li> </ul> </div> </div> <!-- Individual Field Error --> <div class="govuk-form-group govuk-form-group--error"> <label class="govuk-label" for="passport-number">UK passport number</label> <p class="govuk-error-message"> <span class="govuk-visually-hidden">Error:</span> Enter your passport number </p> <input class="govuk-input govuk-input--error" id="passport-number" name="passport-number" type="text" aria-describedby="passport-number-error"> </div>

Validation Principles

  • Clear messaging: Tell users exactly what went wrong
  • Contextual errors: Show errors next to the relevant fields
  • Error summary: List all errors at the top of the page
  • Focus management: Move focus to error summary on submission
  • Preserve input: Don't clear user's data on error

Accessibility Requirements

  • Error summary must have role="alert"
  • Use aria-describedby to associate errors with inputs
  • Include "Error:" prefix for screen readers
  • Ensure error states have sufficient color contrast
  • Test with keyboard navigation and screen readers