NHS.UK frontend v10.0.0 pre-release #1455
Replies: 17 comments 19 replies
-
I've not spotted any issues so far. Here's the pull request where I’ve been testing this on a prototype: NHSDigital/record-a-vaccination-prototype#364 |
Beta Was this translation helpful? Give feedback.
-
Useful feedback from @rowellx68 not realising Which found some GOV.UK Frontend log messages we haven't added yet:
I'm working on a PR for this |
Beta Was this translation helpful? Give feedback.
-
I’ve not spotted any issues so far, here’s the PR where I’ve been testing this on the Mavis prototype: nhsuk/manage-vaccinations-in-schools-prototype#108 |
Beta Was this translation helpful? Give feedback.
-
Here’s the draft pull request for updating the NHS prototype kit: nhsuk/nhsuk-prototype-kit#548 |
Beta Was this translation helpful? Give feedback.
-
Here’s draft pull request for updating the NHS Prototype kit guidance website: nhsuk/nhsuk.service-manual.prototype-kit.docs#297 |
Beta Was this translation helpful? Give feedback.
-
We've started testing with the v10.0.0 pre-release in our Manage breast screening service (prototype) |
Beta Was this translation helpful? Give feedback.
-
I've found a v10 specific issue when the Radios component is initialised late import { initRadios } from 'nhsuk-frontend'
// ✅ Init radios immediately
initRadios()
// ✅ Init radios on DOM ready
addEventListener('DOMContentLoaded', initRadios)
// ✅ Init radios on page load
addEventListener('load', initRadios)
// ❌ Init radios after page load
setTimeout(initRadios, 5000) We lacked test coverage for this so I've fixed that too in: |
Beta Was this translation helpful? Give feedback.
-
Upgrade went smoothly on our small service on screening. The only thing that was missing was the changes in PR-1305 as we use NHS CIS2 authentication we need the button to support a NHS logo within the button. |
Beta Was this translation helpful? Give feedback.
-
@colinrotherham thats right I was able to use the code from 1305 to make it work. @paulrobertlloyd my understanding was the NHS login button does not need the NHS logo when used on an NHS service, not CIS? I'll double check with the CIS team. |
Beta Was this translation helpful? Give feedback.
-
Ready to implement on the Mavis live service, once v10 is ready to release: nhsuk/manage-vaccinations-in-schools#4005 |
Beta Was this translation helpful? Give feedback.
-
Updated the announcement above with the v10.0.0-internal.1 release notes 🙌 |
Beta Was this translation helpful? Give feedback.
-
Looks good to me from NHS App side! We'll just need to finalise how we're aligning our header with the new design before we can bump across the app and our component library. (we're about to merge our v9 update, but keeping our v7 header styling with that) https://github.com/NHSDigital/nhsapp/compare/feature/nhso-0000-bump-nhsuk-frontend...feature/nhso-0000-nhsuk-frontend-v10 |
Beta Was this translation helpful? Give feedback.
-
Updated the announcement above with the v10.0.0-internal.2 release notes 🚀 Thanks @paulrobertlloyd for spotting a few issues in the last pre-release, but some other highlights:
|
Beta Was this translation helpful? Give feedback.
-
After upgrading from v10.0.0-internal.0 to v10.0.0-internal.1 I had an issue with the |
Beta Was this translation helpful? Give feedback.
-
After upgrading to internal v10.0.0-internal.2 I needed to add some classes to both the header and footer as the formatting had changed. I needed to add nhsuk-width-container to the header and add footer class="nhsuk-footer" as the styles went a bit strange. |
Beta Was this translation helpful? Give feedback.
-
Updated the announcement above with the v10.0.0-internal.3 release notes 🚀 We've now added the JavaScript API from GOV.UK Frontend including base component classes Other highlights and thanks for:
|
Beta Was this translation helpful? Give feedback.
-
Hopefully this our last update before we plan to release v10.0.0 next week I've updated the announcement above with the v10.0.0-internal.4 release notes 🚀 You can also see the proposed v10.0.0 changelog (consolidated) in: Highlights from this pre-release include:
Last of all, have we missed any thank you messages?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Any comments or feedback regarding the NHS.UK frontend v10.0.0 pre-release are welcome.
NHS service manual guidance for this release (see PR) is also in preview:
https://nhsuk-service-manual-pr-2192.herokuapp.com
10.0.0-internal.4 - 22 August 2025
💥 Breaking changes
Action link component changes
HTML markup for the action link component has been updated to remove the HTML wrapper. You do not need to do anything if you're using Nunjucks macros.
If you are not using Nunjucks macros, update your HTML markup to:
<div class="nhsuk-action-link"> </div>
<a class="nhsuk-action-link__link"
class attribute to match<a class="nhsuk-action-link"
🆕 New features
Reversed link style for action link
You can now use the action link component on dark backgrounds by using the
.nhsuk-action-link--reverse
class. Added in pull request #1542: Add reverse action link modifiers and styles.Sass colours as CSS custom properties
The Sass applied colour variables (e.g.
$nhsuk-link-colour
) are now available as CSS custom propertiesFor example:
This change was introduced in pull request #1495: Output CSS custom properties from Sass colours.
🔧 Fixes
10.0.0-internal.3 - 15 August 2025
🆕 New features
Sass colour palette
nhsuk-colour
functionThe Sass colour palette variables (e.g.
$color_nhsuk-blue
) have been moved into a new single$nhsuk-colours
map. The previous names are deprecated and will be removed in a future release.If you need to reference a colour within your application you should use the new
nhsuk-colour
function:This was added in pull request #1526: Add
$nhsuk-colour
palette, colour helpers and deprecate "color" spelling.Create individual components with
createAll
We've added a new
createAll
function that lets you initialise specific components in the same way thatinitAll
does.The
createAll
function will:data-module
attributeYou can also pass a config object and a scope within which to search for elements.
You can find out more about how to use the
createAll
function in our documentation.This was added in pull request #1506: Add JavaScript configuration support to components.
🗑️ Deprecated features
Rename Sass variables, mixins and CSS classes to use "colour" spelling
We've renamed all Sass variables, mixins and CSS classes to use "colour" (not "color") spelling. You can still use the previous names but we'll remove them in a future breaking release.
Sass variables
For example, the following variables have been renamed:
$nhsuk-link-color
renamed to$nhsuk-link-colour
$nhsuk-link-hover-color
renamed to$nhsuk-link-hover-colour
$nhsuk-link-active-color
renamed to$nhsuk-link-active-colour
$nhsuk-link-visited-color
renamed to$nhsuk-link-visited-colour
See pull request #1526 for the full list.
Sass mixins
The following mixins have been renamed:
nhsuk-print-color
renamed tonhsuk-print-colour
nhsuk-text-color
renamed tonhsuk-text-colour
CSS classes
The following CSS classes have been renamed:
nhsuk-u-secondary-text-color
renamed tonhsuk-u-secondary-text-colour
This was added in pull request #1526: Add
$nhsuk-colour
palette, colour helpers and deprecate "color" spelling.💥 Breaking changes
Colour variables that have been removed
Sass colour tint and shade variables (e.g.
$color_tint_nhsuk-black-10
) have been removed but are available using thenhsuk-tint
andnhsuk-shade
functions:This change was introduced in pull request #1526: Add
$nhsuk-colour
palette, colour helpers and deprecate "color" spelling.Update back link component
HTML markup for the back link component has been updated to align with GOV.UK Frontend:
You do not need to do anything if you're using Nunjucks macros.
If you are not using Nunjucks macros, update your HTML markup using the back link examples in the NHS digital service manual.
This change was introduced in pull request #1515: Update back link and breadcrumb components.
Update breadcrumbs component
HTML markup for breadcrumbs component has been updated to better align with that used on GOV.UK and use back link styles for presentation on mobile:
Before:
You do not need to do anything if you're using Nunjucks macros.
If you are not using Nunjucks macros, update your HTML markup using the back link examples in the NHS digital service manual.
This change was introduced in pull request #1515: Update back link and breadcrumb components.
Update icons
We have updated the design of some of our icons used in components. You do not need to do anything if you're using Nunjucks macros.
If you are not using Nunjucks macros, update your HTML markup if you are using any of the following components:
Action link
Do and don’t lists
Header
If you are using search, update the search submit icon:
If you are using an account link, update the user icon:
Pagination
Primary card
This change was introduced in pull request #1521: Update component icons.
Check that your favicons, app icons and Open Graph image still work
We've changed the names, formats and sizes of icon assets we distribute in NHS.UK frontend. You will want to check that the correct files are copied in the right place and served at the right URLs.
The following files have been added to the assets folder:
The following folders have been removed from the assets folder:
If you're not using the Nunjucks page template, you will need to replace the list of icons in the template's head with the following:
You will need to update the file path to match your assets folder if it's not at the default location.
This change was introduced in pull request #1508: Update site icons and Open Graph image, add
manifest.json
.♻️ Changes
Remove the X-UA-Compatible meta tag
Remove the
<meta http-equiv="X-UA-Compatible" content="IE=edge">
meta tag from your page template.Internet Explorer versions 8, 9 and 10 included a feature that would try to determine if the page was built for an older version of IE and silently enable compatibility mode, modifying the rendering engine's behaviour to match the older version of IE. Setting this meta tag prevented that behaviour.
IE11 deprecated this meta tag and defaulted to always using IE11's renderer when the page has a HTML5 doctype (
<!DOCTYPE html>
).As NHS.UK frontend no longer supports Internet Explorer versions older than 11, this meta tag can now be removed.
This change was made in pull request #1509: Remove
X-UA-Compatible meta tag
.Update the viewport meta tag
We've updated our grid layout gutter margins to accommodate devices with "camera notches". Browsers on these devices reserve a safe area in landscape orientation (known as pillar-boxing) so content isn't obscured.
To avoid this, support has been added for
viewport-fit=cover
as shown here:https://webkit.org/blog/7929/designing-websites-for-iphone-x/
This change was introduced in pull request #1510: Accommodate camera notches.
🔧 Fixes
clip-path()
for plus and minus icons on details expandernhsuk-shade
andnhsuk-tint
10.0.0-internal.2 - 24 July 2025
🆕 New features
New notification banner component
We’ve added a new notification banner component, ported from the GOV.UK Design System.
This was added in pull request #1408: Add notification banner component.
💥 Breaking changes
You must make the following changes when you migrate to this release, or your service might break.
Update footer component
The footer component's Nunjucks macros and HTML have been updated for better consistency and flexibility.
If you're using the
footer
Nunjucks macro in your service, you must:links
option with the nestednavigation.items
option.metaLinks
option with the nestedmeta.items
option.label
totext
andURL
tohref
.Before:
After:
Or where additional columns
linksColumn2
andlinksColumn3
are currently used, wrap thenavigation
object in an array to support multiple columns:If you are not using Nunjucks macros, update your HTML markup using the footer examples in the NHS digital service manual.
This change was introduced in pull request #1452: Update footer to separate navigation from meta links, and use common parameters.
🔧 Fixes
10.0.0-internal.1 - 22 July 2025
💥 Breaking changes
You must make the following changes when you migrate to this release, or your service might break.
Add missing
data-module
attributes to componentsYou do not need to do anything if you're using Nunjucks macros.
If you are not using Nunjucks macros, add the missing
data-module
attributes to the following components' HTML:This change was introduced in pull request #1480: Add missing component
data-module
attributes.Check that tabs components work as expected
The tabs component no longer triggers the
tab.show
andtab.hide
custom events. Get in touch if you need to continue using these events.This change was introduced in pull request #1469: Remove deprecated code and legacy feature detection.
Check that details components work as expected
The details component no longer uses JavaScript, and is no longer polyfilled in older browsers.
If you have extended browser support requirements, check that the details component works as expected in older browsers.
This change was introduced in pull request #1460: Remove JavaScript from details component.
Check your browser console for component initialisation errors
NHS.UK frontend component JavaScript now provides errors if you initialise a component incorrectly.
These errors will be:
initAll()
functionTo make sure the components behave as intended, we encourage you to check your browser console and address any errors by updating your markup or configuration.
Errors you might see include:
SupportError
- when NHS.UK frontend is not supported in the current browserElementError
- when component templates have missing or broken HTML elementsInitError
- when components are initialised multiple timesThis change was introduced in pull requests #1459: Add NHS.UK frontend browser support checks, #1466: Throw
ElementError
for all missing elements and #1481: Prevent multiple initialisations of a single component instance.🆕 New features
*.d.mts
for NHS.UK frontend🔧 Fixes
id
based onname
aria-describedby
on all form fieldsattributes
option on form groups$nhsuk-breakpoints
option10.0.0-internal.0 - 2 July 2025
This release introduces some breaking changes to file paths, full width buttons on mobile, the header component and others.
It also stops Internet Explorer 11 and other older browsers from running NHS.UK frontend JavaScript. Your service will not stop working in Internet Explorer 11, but components will look and behave differently without JavaScript.
You must read and apply these updates carefully to ensure your service does not break.
🆕 New features
New header with account section
We’ve updated the header component to support account information and links. As part of this work we’ve also made some other improvements to the header, detailed below:
role
andid
attributes.This was added in pull request #1058: New header with account section.
Buttons are now full width on mobile
All buttons are now displayed at full width on mobile. This may not require any changes, but you should check that it does not break any of your layouts.
Buttons and links can also be grouped together so that they appear side-by-side on tablet and desktop by using a
<div class="nhsuk-button-group"> </div>
container.This change was introduced in pull request #1309: Add button group and full width button styles
Create custom width container classes
You can now create custom page width container classes using the
nhsuk-width-container
mixin. You do this by passing in the required maximum width of the container.For example:
You can use the generated classes to set the width of:
It was already possible to set the page app width with the
$nhsuk-page-width
variable. This new feature is useful when creating additional custom page width classes.This change was introduced in #1412: Allow creating custom width containers
💥 Breaking changes
You must make the following changes when you migrate to this release, or your service might break.
Update file paths
To make sure NHS.UK frontend's files do not conflict with your code, we've moved our package files from
packages
todist/nhsuk
.Make the following changes if they apply to your service:
Update Sass file paths
You must add
node_modules
to Sass load paths, by either:--load-path node_modules
flagloadPaths: ['node_modules']
in theoptions
objectReplace
packages
withdist/nhsuk
for any@forward
,@use
or@import
paths in your Sass files, making sure to remove the unnecessarynode_modules/
prefix:Update precompiled CSS file paths
For precompiled stylesheets, note the following path changes:
node_modules/dist/nhsuk/nhsuk-frontend.min.css
– not the previous
node_modules/dist/nhsuk.min.css
stylesheetnhsuk-frontend-<VERSION-NUMBER>.min.css
from the GitHub release zip file– not the previous
css/nhsuk-<VERSION-NUMBER>.min.css
stylesheetUpdate precompiled JavaScript file paths
For precompiled JavaScript, note the following path changes:
node_modules/dist/nhsuk/nhsuk-frontend.min.js
– not the previous
node_modules/dist/nhsuk.min.js
scriptnhsuk-frontend-<VERSION-NUMBER>.min.js
from the GitHub release zip file– not the previous
js/nhsuk-<VERSION-NUMBER>.min.js
scriptThen include the script before the closing
</body>
tag of your page using thetype="module"
attribute, and run theinitAll
function to initialise all the components.Before:
After:
Update JavaScript file paths for bundlers
For JavaScript imported using a bundler, consolidate all
import
orrequire()
calls tonhsuk-frontend/packages/components/*
into a single statement:Ensuring component initialisation functions match the named exports:
Or alternatively, you can initialise individual component classes:
Update Nunjucks file paths
nunjucks.configure()
to search withinnode_modules/nhsuk-frontend/dist
:Update file paths for copying or serving assets
Replace
packages/
withdist/nhsuk
when copying or serving NHS.UK frontend logos, icons and other assets:For example, if you're using Express.js, request routing could be set up as follows:
Verify your code does not rely on polyfills we have now removed
We have removed polyfills
Array.prototype.includes
,CustomEvent
,Element.closest()
,matches()
DOM method and NodeList APIforEach
required for Internet Explorer 11 and below.However, because these polyfills create or extend global objects ('polluting the global namespace'), you might have other code in your service unintentionally relying on the inclusion of these polyfills. You might need to introduce your own polyfills or rewrite your JavaScript to avoid using the polyfilled features.
These changes were introduced in pull request #1326: Remove IE11 vendor polyfills.
Stop Internet Explorer 11 and other older browsers running unsupported JavaScript
Add
type="module"
to all HTML<script>
tags that include or bundle NHS.UK frontend.This is to stop Internet Explorer 11 and other older browsers running the JavaScript, which relies on features older browsers might not support and could cause errors.
Please note that
<script>
withtype="module"
runs JavaScript in a slightly different way than<script>
withouttype="module"
. You'll need to assess the impact of these nuances and make sure that:<script>
tag, you'll need to make sure it's usingtype="module"
ordefer
. This is because the tag loading NHS.UK frontend will be deferred because of itstype="module"
attribute<script>
tag withouttype="module"
If your service has JavaScript you want to run successfully in Internet Explorer (for example JavaScript for analytics), you will need to load it in a separate
<script>
tag withouttype="module"
and make sure its code is compatible with the browsers it should run in (see previous section about polyfills).These changes were introduced in pull request #1260: Remove legacy browser support with
<script type="module">
.Update the
<script>
snippet at the top of your<body>
tagPage templates now include a new
nhsuk-frontend-supported
class on the<body>
tag when NHS.UK frontend JavaScript components are fully supported.If you are not using our Nunjucks page template, replace the existing snippet:
with:
These changes were introduced in pull request #1327: Add class
.nhsuk-frontend-supported
for ES modules support.Update header component params
If you're using the
header
Nunjucks macro in your service, you must:transactionalService
option to the newservice
option, and remove the booleantransactional
option.primaryLinks
option with the nestednavigation.items
option, usingtext
andhref
instead oflabel
andurl
.searchAction
option with the nestedsearch.action
option.searchInputName
option with the nestedsearch.name
option.showNav
andshowSearch
options. The respective parts of the header are now shown automatically whennavigation.items
orsearch
options are provided.classes
option fornhsuk-header--white-nav
and remove it. To turn the navigation white, add the modifier classnhsuk-header__navigation--white
to the nestednavigation.classes
option.nhsuk-header__navigation-list--left-aligned
modifier class, navigation items are now aligned left by default.To restore the previous justified alignment, where navigation items appeared evenly spaced out, add the new
nhsuk-header__navigation--justified
modifier class to the nestednavigation.classes
option.Update header component HTML markup
If you are not using Nunjucks macros, update your HTML markup using the header examples in the NHS digital service manual.
Rename component
HTML
param tohtml
If you're using the
card
,details
,insetText
orwarningCallout
Nunjucks macros, you need to rename theHTML
param tohtml
:This change was made in pull request #1259: Review legacy Nunjucks params.
Rename details component
text
param tosummaryText
If you're using the
details
Nunjucks macro you need to rename thetext
param tosummaryText
:This change ensures consistency with other components, where
text
orhtml
params are alternatives and cannot be used together. For example, when only text content is necessary:This change was made in pull requests #1259: Review legacy Nunjucks params and #1398: Document details component
summaryText
andsummaryHtml
macro options.Remove deprecated 24 point on the typography scale
The point 24 (24px large screens, 20px small screens) on the typography scale has been removed, after previously being deprecated in version 9.5.0.
Use either point 22 or point 26 instead.
This change was introduced in #1139: Remove 24px from typography scale
Remove the
nhsuk-button--disabled
class from buttonsWe've removed support for the
nhsuk-button--disabled
class.For the button component, remove any references to the
nhsuk-button--disabled
class.Use the
disabled
HTML boolean attribute to mark<button>
elements as being disabled instead.We no longer support link buttons being disabled or using disabled styles.
This change was introduced in #1075: Remove support for
nhsuk-button--disabled
classRemove deprecated Sass mixins and functions
We've removed the
govuk-main-wrapper()
,govuk-main-wrapper--l()
andgovuk-main-wrapper--s()
Sass mixins we deprecated in NHS.UK frontend v9.5.0.Remove any use of these mixins in your own Sass. You must replace them with the
.nhsuk-main-wrapper
,.nhsuk-main-wrapper--l
and.nhsuk-main-wrapper--s
classes in your HTML.If you're using the
nhsuk-grid-column()
Sass mixin to create custom grid classes, you must remove the$class
parameter:See the full list of previously deprecated features below:
Sass mixins
The following mixins have been removed:
govuk-exports
replaced withnhsuk-exports
govuk-grid-column
replaced withnhsuk-grid-column
govuk-grid-row
replaced with.nhsuk-grid-row
HTML classgovuk-shape-arrow
replaced withnhsuk-shape-arrow
govuk-width-container
replaced withnhsuk-width-container
grid-width
replaced withnhsuk-grid-width
Sass functions
The following deprecated functions have been removed:
tint
replaced withnhsuk-tint
shade
replaced withnhsuk-shade
iff
replaced with Sassif
functionThis change was introduced in #1409: Remove deprecated features marked for removal in v10.
See the NHS.UK frontend v9.5.0 and NHS.UK frontend v9.6.0 release notes for more details on previously deprecated features.
Update links in the error summary to the first checkbox or radio item
If you've linked from an error summary component to the first input in a radios or checkboxes component, the link may no longer work.
This is because the
id
of the first checkbox or radio item no longer has the suffix-1
when rendered using the Nunjucks macros.If you're using the
errorSummary
Nunjucks macro, remove-1
from the end of thehref
attribute:You do not need to do this if you specified an
id
for the individual checkbox or radio item.This change was introduced in #1112: Remove the -1 suffix from radio and checkbox IDs
♻️ Changes
We've made changes to NHS.UK frontend in the following pull requests:
🔧 Fixes
value
,disabled
andformGroup
paramsThis discussion was created from the release NHS.UK frontend v10.0.0-internal.2.
Beta Was this translation helpful? Give feedback.
All reactions