├── .nvmrc ├── src ├── assets │ ├── .gitkeep │ └── icons │ │ ├── chevron-right.svg │ │ ├── cross-filled.svg │ │ ├── sort.svg │ │ ├── heart-filled.svg │ │ ├── messages.svg │ │ ├── messages-filled.svg │ │ ├── home-filled.svg │ │ ├── account.svg │ │ ├── messages-unread.svg │ │ ├── home.svg │ │ ├── messages-unread-filled.svg │ │ ├── cross.svg │ │ ├── filter.svg │ │ ├── heart.svg │ │ ├── letter.svg │ │ ├── help.svg │ │ ├── switch-profile.svg │ │ ├── download.svg │ │ ├── night.svg │ │ ├── clock.svg │ │ ├── calendar.svg │ │ └── email.svg ├── settings │ ├── _colours.scss │ ├── _colours-applied.scss │ └── _colours-palette.scss ├── components │ ├── tag │ │ ├── macro.njk │ │ ├── tag.njk │ │ └── macro-options.md │ ├── timeline │ │ ├── macro.njk │ │ ├── timeline.njk │ │ └── macro-options.md │ ├── badge │ │ ├── large │ │ │ ├── macro.njk │ │ │ ├── badge-large.njk │ │ │ └── macro-options.md │ │ ├── small │ │ │ ├── macro.njk │ │ │ ├── badge-small.njk │ │ │ └── macro-options.md │ │ └── _badge.scss │ ├── card │ │ ├── macro.njk │ │ └── card-group.njk │ ├── button │ │ └── _index.scss │ └── summary-list │ │ └── _index.scss ├── styles │ └── icon │ │ ├── macro.njk │ │ ├── _icons.scss │ │ └── icons.njk ├── utilities │ ├── _truncate.scss │ └── _display.scss └── all.scss ├── docs ├── _data │ ├── data.json │ └── redirects.js ├── assets │ ├── css │ │ ├── _utilities.scss │ │ ├── components │ │ │ ├── _callout.scss │ │ │ ├── _header-native.scss │ │ │ ├── _hero.scss │ │ │ ├── _top-nav-native.scss │ │ │ └── _bottom-nav-native.scss │ │ ├── _container.scss │ │ ├── _content.scss │ │ ├── _code-colours.scss │ │ ├── _colour.scss │ │ ├── _tabs.scss │ │ ├── _mobile-iframe.scss │ │ └── app.scss │ ├── images │ │ ├── icons.png │ │ ├── top-nav.png │ │ ├── bottom-nav.png │ │ ├── open-graph.png │ │ ├── top-nav-2.png │ │ ├── bottom-nav-2.png │ │ ├── github-issue.png │ │ ├── bottom-nav-badge.png │ │ ├── campaign-card-image.jpg │ │ ├── github-board-search.png │ │ ├── github-comment-edit.png │ │ ├── propose-change-edit.png │ │ ├── propose-change-file.png │ │ ├── propose-change-fork.png │ │ ├── propose-change-link.png │ │ ├── github-comment-message.png │ │ ├── propose-change-confirm.png │ │ ├── propose-change-message.png │ │ ├── propose-change-request.png │ │ └── error-pages │ │ │ ├── log-in-1120.png │ │ │ ├── connect-to-app-1120.png │ │ │ ├── no-appointments-1120.png │ │ │ └── confirmed-prescriptions-1120.png │ └── js │ │ ├── app.njk │ │ ├── app.js │ │ └── copy.js ├── _includes │ └── layouts │ │ ├── partials │ │ ├── notice-homepage.njk │ │ ├── get-help.njk │ │ ├── footer-web.njk │ │ ├── side-navigation-item.njk │ │ ├── propose-change.njk │ │ ├── header-native.njk │ │ ├── top-nav-native.njk │ │ ├── header-web.njk │ │ ├── feedback-section.njk │ │ ├── side-navigation.njk │ │ └── bottom-nav-native.njk │ │ ├── example.njk │ │ ├── example-full-page-web.njk │ │ ├── example-full-page-mobile-not-logged-in.njk │ │ ├── plain.njk │ │ ├── example-full-page-mobile.njk │ │ ├── nhsapp-prototype.njk │ │ ├── style.njk │ │ ├── sidebar.njk │ │ ├── get-started.njk │ │ ├── community.njk │ │ ├── component.njk │ │ ├── pattern.njk │ │ └── base.njk ├── examples │ ├── header │ │ ├── header-not-logged-in.njk │ │ └── header-logged-in.njk │ ├── buttons │ │ ├── button-primary.njk │ │ ├── button-reverse.njk │ │ ├── button-secondary.njk │ │ └── button-warning.njk │ ├── badges │ │ ├── badge-large.njk │ │ ├── badge-large-9.njk │ │ └── badge-small.njk │ ├── cards │ │ ├── card-link-short.njk │ │ ├── card-link-secondary.njk │ │ ├── card-link-with-image.njk │ │ ├── card-link-with-description.njk │ │ ├── card-with-no-link.njk │ │ ├── card-link-with-badge.njk │ │ ├── card-link.njk │ │ ├── card-link-light-blue.njk │ │ ├── card-group-stacked.njk │ │ ├── card-group-headings.njk │ │ ├── card-group-custom-heading.njk │ │ ├── card-group-stacked-secondary.njk │ │ ├── card-link-accessibility.njk │ │ ├── card-group.njk │ │ ├── card-link-custom.njk │ │ ├── card-link-with-footer.njk │ │ └── card-messages.njk │ ├── page-not-found │ │ ├── native.njk │ │ └── web.njk │ ├── error-pages │ │ ├── update-app.njk │ │ ├── check-internet-connection.njk │ │ ├── manage-services.njk │ │ ├── confirmed-prescriptions.njk │ │ ├── show-gp-appointments.njk │ │ └── template.njk │ ├── timeline │ │ ├── timeline-active.njk │ │ └── timeline-inactive.njk │ ├── sub-hub-pages │ │ ├── care-plans.njk │ │ ├── appointments.njk │ │ └── prescriptions.njk │ └── hub-pages │ │ ├── account.njk │ │ ├── example.njk │ │ ├── your-health.njk │ │ ├── services.njk │ │ └── messages.njk ├── components │ ├── section-heading.md │ ├── header.md │ ├── index.md │ ├── buttons.md │ ├── tag.md │ ├── top-navigation.md │ ├── bottom-navigation.md │ ├── badge.md │ └── timeline.md ├── community │ ├── design-history.md │ ├── help-and-feedback.md │ ├── index.md │ ├── propose-components-or-patterns.md │ └── suggest-a-change.md ├── styles │ ├── index.md │ └── icons.md ├── page-not-found.njk ├── patterns │ ├── index.md │ ├── page-not-found.md │ ├── homepage.md │ ├── learn-about-health-campaigns.md │ ├── sub-hub-page.md │ └── hub-page.md ├── redirects.11ty.js └── get-started │ ├── nhsapp-frontend.md │ ├── nhsapp-prototype │ ├── github.md │ ├── index.md │ ├── setup.md │ ├── heroku.md │ └── how-to-use.md │ ├── installing-with-npm.md │ ├── information-architecture.md │ └── install-nhsapp-frontend.md ├── .gitignore ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── documentation.yaml │ ├── bug_report.yaml │ ├── new_feature.yaml │ ├── design_defect.yaml │ └── accessibility_issue.yaml └── workflows │ ├── pr.yaml │ ├── docs.yaml │ └── publish.yaml ├── .prettierrc.js ├── LICENSE ├── README.md └── package.json /.nvmrc: -------------------------------------------------------------------------------- 1 | v20 2 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_data/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": 2 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | .DS_Store 4 | docs/_includes/nhsapp 5 | -------------------------------------------------------------------------------- /docs/assets/css/_utilities.scss: -------------------------------------------------------------------------------- 1 | .app-u-hidden { 2 | display: none; 3 | } 4 | -------------------------------------------------------------------------------- /src/settings/_colours.scss: -------------------------------------------------------------------------------- 1 | @forward "colours-palette"; 2 | @forward "colours-applied"; 3 | -------------------------------------------------------------------------------- /docs/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/icons.png -------------------------------------------------------------------------------- /src/components/tag/macro.njk: -------------------------------------------------------------------------------- 1 | {% macro nhsappTag(params) %} 2 | {%- include "./tag.njk" -%} 3 | {% endmacro %} -------------------------------------------------------------------------------- /docs/assets/images/top-nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/top-nav.png -------------------------------------------------------------------------------- /docs/assets/images/bottom-nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/bottom-nav.png -------------------------------------------------------------------------------- /docs/assets/images/open-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/open-graph.png -------------------------------------------------------------------------------- /docs/assets/images/top-nav-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/top-nav-2.png -------------------------------------------------------------------------------- /docs/assets/images/bottom-nav-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/bottom-nav-2.png -------------------------------------------------------------------------------- /docs/assets/images/github-issue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/github-issue.png -------------------------------------------------------------------------------- /docs/assets/js/app.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: assets/js/app.js 3 | --- 4 | {% include "js/tabs.js" %} 5 | {% include "js/copy.js" %} 6 | -------------------------------------------------------------------------------- /src/components/timeline/macro.njk: -------------------------------------------------------------------------------- 1 | {% macro nhsappTimeline(params) %} 2 | {%- include "./timeline.njk" -%} 3 | {% endmacro %} 4 | -------------------------------------------------------------------------------- /docs/assets/images/bottom-nav-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/bottom-nav-badge.png -------------------------------------------------------------------------------- /src/components/badge/large/macro.njk: -------------------------------------------------------------------------------- 1 | {% macro nhsappBadgeLarge(params) %} 2 | {%- include "./badge-large.njk" -%} 3 | {% endmacro %} 4 | -------------------------------------------------------------------------------- /src/components/badge/small/macro.njk: -------------------------------------------------------------------------------- 1 | {% macro nhsappBadgeSmall(params) %} 2 | {%- include "./badge-small.njk" -%} 3 | {% endmacro %} 4 | -------------------------------------------------------------------------------- /docs/assets/images/campaign-card-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/campaign-card-image.jpg -------------------------------------------------------------------------------- /docs/assets/images/github-board-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/github-board-search.png -------------------------------------------------------------------------------- /docs/assets/images/github-comment-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/github-comment-edit.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-edit.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-file.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-fork.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-link.png -------------------------------------------------------------------------------- /docs/assets/js/app.js: -------------------------------------------------------------------------------- 1 | // Entry point for docs site JS (loaded as a module in base layout) 2 | import './tabs.js' 3 | import './copy.js' 4 | -------------------------------------------------------------------------------- /docs/assets/images/github-comment-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/github-comment-message.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-confirm.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-message.png -------------------------------------------------------------------------------- /docs/assets/images/propose-change-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/propose-change-request.png -------------------------------------------------------------------------------- /docs/assets/images/error-pages/log-in-1120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/error-pages/log-in-1120.png -------------------------------------------------------------------------------- /docs/assets/images/error-pages/connect-to-app-1120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/error-pages/connect-to-app-1120.png -------------------------------------------------------------------------------- /docs/assets/images/error-pages/no-appointments-1120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/error-pages/no-appointments-1120.png -------------------------------------------------------------------------------- /src/styles/icon/macro.njk: -------------------------------------------------------------------------------- 1 | {% import "../icon/icons.njk" as iconHtml %} 2 | 3 | {% macro nhsappIcon(iconName) %} 4 | {{ iconHtml[iconName]() }} 5 | {% endmacro %} 6 | -------------------------------------------------------------------------------- /docs/assets/images/error-pages/confirmed-prescriptions-1120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhsuk/nhsapp-frontend/HEAD/docs/assets/images/error-pages/confirmed-prescriptions-1120.png -------------------------------------------------------------------------------- /src/components/card/macro.njk: -------------------------------------------------------------------------------- 1 | {% macro nhsappCard(params) %} 2 | {%- include "./card.njk" -%} 3 | {% endmacro %} 4 | 5 | {% macro nhsappCardGroup(params) %} 6 | {%- include "./card-group.njk" -%} 7 | {% endmacro %} 8 | -------------------------------------------------------------------------------- /src/utilities/_truncate.scss: -------------------------------------------------------------------------------- 1 | .nhsapp-u-truncate-two-lines { 2 | margin-right: 0; 3 | display: -webkit-box; 4 | -webkit-line-clamp: 2; 5 | -webkit-box-orient: vertical; 6 | overflow: hidden; 7 | text-overflow: ellipsis; 8 | } 9 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/notice-homepage.njk: -------------------------------------------------------------------------------- 1 |
2 |

We're currently reviewing the homepage as part of an information architecture review.

3 |
-------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Get in touch another way 4 | url: https://design-system.nhsapp.service.nhs.uk/community/help-and-feedback/ 5 | about: Find out how to get in touch via email or Slack. 6 | -------------------------------------------------------------------------------- /src/components/tag/tag.njk: -------------------------------------------------------------------------------- 1 | {% from "nhsuk/macros/attributes.njk" import nhsukAttributes %} 2 | 3 | 4 | {{ params.html | safe if params.html else params.text }} 5 | -------------------------------------------------------------------------------- /.github/workflows/pr.yaml: -------------------------------------------------------------------------------- 1 | name: PR checks 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | linting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - uses: actions/setup-node@v4 11 | with: 12 | node-version: '20' 13 | - run: npm ci 14 | - run: npm run lint 15 | -------------------------------------------------------------------------------- /docs/_includes/layouts/example.njk: -------------------------------------------------------------------------------- 1 | --- 2 | htmlAttributes: 3 | class: app-html-background-colour-grey-5 4 | --- 5 | 6 | {% extends "./base.njk" %} 7 | 8 | {% block skiplink %}{% endblock %} 9 | {% block header %}{% endblock %} 10 | {% block footer %}{% endblock %} 11 | 12 | {% block content %} 13 | {{ content | safe }} 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /docs/_includes/layouts/example-full-page-web.njk: -------------------------------------------------------------------------------- 1 | {% extends "./base.njk" %} 2 | 3 | {% block header %} 4 | {% include "layouts/partials/header-web.njk" %} 5 | {% endblock %} 6 | 7 | {% block footer %} 8 | {% include "layouts/partials/footer-web.njk" %} 9 | {% endblock %} 10 | 11 | {% block content %} 12 | {{ content | safe }} 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /src/utilities/_display.scss: -------------------------------------------------------------------------------- 1 | @use "nhsuk-frontend/dist/nhsuk/core/tools/sass-mq" as *; 2 | 3 | .nhsapp-u-hide-from-tablet { 4 | @include nhsuk-media-query($from: tablet) { 5 | display: none !important; 6 | } 7 | } 8 | 9 | .nhsapp-u-hide-until-tablet { 10 | @include nhsuk-media-query($until: tablet) { 11 | display: none !important; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/get-help.njk: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Get help

4 |

The NHS App design system team provides support for users of the NHS App design system. Contact us to ask for help.

5 |
6 |
-------------------------------------------------------------------------------- /docs/examples/header/header-not-logged-in.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Header (web) not logged in 4 | figmaLink: 5 | vueLink: 6 | --- 7 | 8 | {% from 'header/macro.njk' import header %} 9 | 10 | {{ header({ 11 | service: { 12 | text: 'App homepage' | safe, 13 | href: '#' 14 | } 15 | }) }} 16 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/footer-web.njk: -------------------------------------------------------------------------------- 1 | {{ footer({ 2 | meta: { 3 | items: [ 4 | { 5 | "href": "#", 6 | "text": "Terms of use" 7 | }, 8 | { 9 | "href": "#", 10 | "text": "Privacy policy" 11 | }, 12 | { 13 | "href": "#", 14 | "text": "Help and support" 15 | }, 16 | { 17 | "href": "#", 18 | "text": "Accessibility statement" 19 | } 20 | ] 21 | } 22 | }) }} -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/side-navigation-item.njk: -------------------------------------------------------------------------------- 1 | {% set active = item.url === params.currentPath %} 2 | 3 |
  • 4 | 5 | {{- item.data.title -}} 6 | 7 |
  • 8 | -------------------------------------------------------------------------------- /docs/assets/css/components/_callout.scss: -------------------------------------------------------------------------------- 1 | // Custom component for the NHS App deign system documentation 2 | .app-callout { 3 | @include nhsuk-responsive-margin(5, "bottom"); 4 | @include nhsuk-responsive-padding(4); 5 | 6 | border: nhsuk-spacing(1) solid nhsuk-colour("blue"); 7 | 8 | &__content { 9 | @include nhsuk-reading-width(); 10 | 11 | :last-child { 12 | margin-bottom: 0; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/icons/chevron-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/all.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "settings/colours"; 3 | 4 | // styles 5 | @import "styles/icon/icons"; 6 | 7 | // components 8 | @import "components/badge/badge"; 9 | @import "components/button"; 10 | @import "components/card/card"; 11 | @import "components/tag/tag"; 12 | @import "components/timeline/timeline"; 13 | @import "components/summary-list"; 14 | 15 | // utilities 16 | @import "utilities/display"; 17 | @import "utilities/truncate"; 18 | -------------------------------------------------------------------------------- /docs/_includes/layouts/example-full-page-mobile-not-logged-in.njk: -------------------------------------------------------------------------------- 1 | --- 2 | htmlAttributes: 3 | class: app-html-background-colour-grey-5 4 | --- 5 | 6 | {% extends "./base.njk" %} 7 | 8 | {% block skiplink %}{% endblock %} 9 | 10 | {% block header %} 11 | {% include "layouts/partials/header-native.njk" %} 12 | {% endblock %} 13 | 14 | {% block footer %} 15 | {% endblock %} 16 | 17 | {% block content %} 18 | {{ content | safe }} 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /docs/assets/css/_container.scss: -------------------------------------------------------------------------------- 1 | // App main container 2 | .app-width-container { 3 | padding-top: 60px; // to give correct spacing for sticky header 4 | } 5 | 6 | // App main wrapper 7 | .app-main-wrapper { 8 | padding: 0 0 130px; // to give correct spacing for sticky footer 9 | } 10 | 11 | // App html class 12 | // Removes the dark grey background at the bottom of shorter pages 13 | .app-html-background-colour-grey-5 { 14 | background-color: nhsuk-colour("grey-5"); 15 | } 16 | -------------------------------------------------------------------------------- /docs/assets/css/components/_header-native.scss: -------------------------------------------------------------------------------- 1 | .app-header--native { 2 | .nhsuk-header__container { 3 | display: flex; 4 | justify-content: center; 5 | padding: 16px 0; 6 | } 7 | .nhsuk-logo { 8 | border: 0; 9 | display: block; 10 | height: 32px; 11 | width: 80px; 12 | 13 | .nhsuk-logo__background { 14 | fill: nhsuk-colour("white"); 15 | } 16 | .nhsuk-logo__text { 17 | fill: nhsuk-colour("blue"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/examples/buttons/button-primary.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Button primary 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-4944&t=nezigF25kUAyUU2s-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbutton--docs 6 | --- 7 | 8 | {% from 'button/macro.njk' import button %} 9 | 10 | {{ button({ 11 | text: 'Continue', 12 | classes: 'nhsapp-button' 13 | }) }} -------------------------------------------------------------------------------- /src/assets/icons/cross-filled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/settings/_colours-applied.scss: -------------------------------------------------------------------------------- 1 | @use "sass:map"; 2 | @use "colours-palette" as palette; 3 | 4 | /// Returns a colour from the NHS App palette by name. 5 | /// Example: color: nhsapp-colour("dark-blue"); 6 | @function nhsapp-colour($name, $fallback: null) { 7 | $value: map.get(palette.$nhsapp-colours, $name); 8 | @if $value == null { 9 | @if $fallback != null { 10 | @return $fallback; 11 | } 12 | @error "Unknown nhsapp colour `#{$name}`"; 13 | } 14 | @return $value; 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/icons/sort.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/examples/buttons/button-reverse.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Button reverse 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-4944&t=nezigF25kUAyUU2s-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbutton--docs 6 | --- 7 | 8 | {% from 'button/macro.njk' import button %} 9 | 10 | {{ button({ 11 | text: 'Continue', 12 | classes: 'nhsuk-button--reverse nhsapp-button' 13 | }) }} 14 | -------------------------------------------------------------------------------- /docs/examples/buttons/button-secondary.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Button secondary 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-4944&t=nezigF25kUAyUU2s-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbutton--docs 6 | --- 7 | 8 | {% from 'button/macro.njk' import button %} 9 | 10 | {{ button({ 11 | text: 'Try again', 12 | classes: 'nhsuk-button--secondary nhsapp-button' 13 | }) }} -------------------------------------------------------------------------------- /docs/examples/buttons/button-warning.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Button warning 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-4944&t=nezigF25kUAyUU2s-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbutton--docs 6 | --- 7 | 8 | {% from 'button/macro.njk' import button %} 9 | 10 | {{ button({ 11 | text: 'Cancel appointment', 12 | classes: 'nhsuk-button--warning nhsapp-button' 13 | }) }} -------------------------------------------------------------------------------- /src/components/button/_index.scss: -------------------------------------------------------------------------------- 1 | @use "nhsuk-frontend/dist/nhsuk/core/tools/spacing" as *; 2 | 3 | $button-border-radius: nhsuk-spacing(2); 4 | 5 | .nhsapp-button, 6 | .nhsapp-button.nhsuk-button--secondary::before, 7 | .nhsapp-button.nhsuk-button--secondary:active { 8 | border-radius: $button-border-radius; 9 | } 10 | 11 | .nhsapp-button.nhsuk-button--secondary:not(:focus)::after, 12 | .nhsapp-button.nhsuk-button--secondary-solid:not(:focus)::after { 13 | border-radius: $button-border-radius - 2px !important; 14 | } 15 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Prettier config 3 | * 4 | * @type {import('prettier').Config} 5 | */ 6 | export default { 7 | semi: false, 8 | singleQuote: true, 9 | trailingComma: 'none', 10 | overrides: [ 11 | { 12 | files: '*.md', 13 | options: { 14 | embeddedLanguageFormatting: 'off', 15 | singleQuote: false 16 | } 17 | }, 18 | { 19 | files: '*.scss', 20 | options: { 21 | printWidth: 120, 22 | singleQuote: false 23 | } 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /docs/assets/css/components/_hero.scss: -------------------------------------------------------------------------------- 1 | // Hero overrides 2 | // Reduces spacing on mobile screens 3 | .app-hero { 4 | background-color: nhsuk-colour("blue"); 5 | 6 | .nhsuk-hero__wrapper { 7 | @include nhsuk-media-query($until: tablet) { 8 | padding-bottom: nhsuk-spacing(5); 9 | padding-top: nhsuk-spacing(5); 10 | } 11 | } 12 | } 13 | 14 | .app-hero-img { 15 | margin: 56px auto 56px auto; 16 | max-width: 100%; 17 | 18 | @include nhsuk-media-query($until: desktop) { 19 | display: none; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/assets/css/_content.scss: -------------------------------------------------------------------------------- 1 | .app-content { 2 | @include nhsuk-media-query($from: desktop) { 3 | padding-bottom: nhsuk-spacing(7); 4 | } 5 | 6 | img { 7 | @include nhsuk-responsive-margin(5, "bottom"); 8 | @include nhsuk-responsive-margin(5, "top"); 9 | 10 | background-color: nhsapp-colour("pale-blue"); 11 | border: nhsuk-spacing(1) solid nhsapp-colour("pale-blue"); 12 | display: block; // To remove extra spacing beneath images 13 | max-width: 100%; // So images do not break the container 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/icons/heart-filled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/components/section-heading.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Section heading 4 | backlogID: 26 5 | tags: 6 | - archivedComponent 7 | --- 8 | 9 | We archived the NHS App section heading in September 2025. 10 | 11 | If you need a heading for a group of card links, use the [card link group component](/components/card-links#using-headings). 12 | 13 | If you need a standalone section heading (without card links), use the [headings from the NHS design system](https://service-manual.nhs.uk/design-system/styles/typography#headings). 14 | -------------------------------------------------------------------------------- /docs/examples/badges/badge-large.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Badge Large 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=9994-822&t=Py584cYX2kHgWqGG-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbadge-large--docs 6 | arguments: badge/large 7 | --- 8 | 9 | {% from 'nhsapp/components/badge/large/macro.njk' import nhsappBadgeLarge %} 10 | 11 | {{ nhsappBadgeLarge({ 12 | count: 3, 13 | label: 'notifications' 14 | }) }} 15 | -------------------------------------------------------------------------------- /docs/examples/badges/badge-large-9.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Badge Large 9 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=9994-822&t=Py584cYX2kHgWqGG-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbadge-large--docs 6 | arguments: badge/large 7 | --- 8 | 9 | {% from 'nhsapp/components/badge/large/macro.njk' import nhsappBadgeLarge %} 10 | 11 | {{ nhsappBadgeLarge({ 12 | count: 10, 13 | label: 'notifications' 14 | }) }} 15 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/propose-change.njk: -------------------------------------------------------------------------------- 1 |
    2 |

    Help improve this page

    3 |

    Propose a change on GitHub. To find out how, read how to propose changes in GitHub.

    4 |
    -------------------------------------------------------------------------------- /src/assets/icons/messages.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/messages-filled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/badge/small/badge-small.njk: -------------------------------------------------------------------------------- 1 | {% from "nhsuk/macros/attributes.njk" import nhsukAttributes %} 2 | 3 | 4 | 5 | {{ params.label }} 6 | {{ params.html | safe if params.html else params.text }} 7 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-short.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link short 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardlink--default 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | title: 'Request repeat prescriptions', 13 | href: '#' 14 | }) }} 15 | -------------------------------------------------------------------------------- /src/assets/icons/home-filled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/badge/large/badge-large.njk: -------------------------------------------------------------------------------- 1 | {% from "nhsuk/macros/attributes.njk" import nhsukAttributes %} 2 | 3 | {%- if params.count -%} 4 |

    5 | You have 6 | {% if params.count > 9 %} 7 | 9+ 8 | {% else %} 9 | {{ params.count }} 10 | {% endif %} 11 | {{ params.label }} 12 |

    13 | {%- endif -%} -------------------------------------------------------------------------------- /docs/community/design-history.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/community.njk 3 | title: Write a design history 4 | order: 6 5 | description: The NHS App design history is a record of design and research for the NHS App. 6 | tags: 7 | - contribution 8 | --- 9 | 10 | There are lots of [benefits to writing design history posts](https://nhsdigital.github.io/design-history-nhsapp/guide/why-we-write-design-histories/). They help us remember and share what has been done and why. 11 | 12 | Find out more on the [NHS App design history website](https://nhsdigital.github.io/design-history-nhsapp/). 13 | -------------------------------------------------------------------------------- /docs/examples/badges/badge-small.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Badge Small 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=9994-822&t=Py584cYX2kHgWqGG-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhsbadge-small--docs 6 | arguments: badge/small 7 | --- 8 | 9 | {% from 'nhsapp/components/badge/small/macro.njk' import nhsappBadgeSmall %} 10 | 11 | {{ nhsappBadgeSmall({ 12 | label: 'New', 13 | text: 'Document attached', 14 | classes: 'nhsuk-body-m' 15 | }) }} 16 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-secondary.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link secondary 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-7303&t=Bvw33PoP6TmBpN41-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardlink--secondary 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | title: 'Find NHS services near you', 13 | href: '#', 14 | classes: 'nhsapp-card--secondary' 15 | }) }} -------------------------------------------------------------------------------- /docs/examples/page-not-found/native.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | title: Page not found 5 | figmaLink: 6 | vueLink: 7 | --- 8 | 9 |
    10 |
    11 | 12 |

    Page not found

    13 | 14 |

    We'll fix this link as soon as possible. Try again later or use a different service.

    15 | 16 |

    For urgent medical advice, use 111 online or call 111.

    17 | 18 |
    19 |
    -------------------------------------------------------------------------------- /docs/examples/cards/card-link-with-image.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card campaign 4 | figmaLink: 5 | vueLink: 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | classes: 'nhsapp-card--dark-blue', 13 | href: '#', 14 | title: 'Help change the NHS', 15 | titleClasses: 'nhsuk-u-font-size-26', 16 | descriptionHtml: '

    Have your say on making the NHS fit for the future

    ', 17 | img: { 18 | src: '../../../assets/images/campaign-card-image.jpg' 19 | } 20 | }) }} 21 | -------------------------------------------------------------------------------- /src/assets/icons/account.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/styles/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/style.njk 3 | isIndex: true 4 | title: Styles 5 | description: Make services look and feel like the NHS App. 6 | --- 7 | 8 | Use these styles in addition to those in the [NHS design system](https://service-manual.nhs.uk/design-system). 9 | 10 | ## Iterating a style 11 | 12 | Use existing styles as starting points, but you may need to iterate them to meet user needs for particular services. 13 | 14 | Before iterating a style make sure there is a clear user need to do so. 15 | 16 | [Share any changes you make or research findings](/community/share-findings/) in the NHS App design system backlog. 17 | -------------------------------------------------------------------------------- /src/assets/icons/messages-unread.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-with-description.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link with description 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardlink--with-simple-content 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | title: 'Your approved prescriptions', 13 | href: '#', 14 | description: 'View prescriptions ready for pharmacy to prepare' 15 | }) }} 16 | -------------------------------------------------------------------------------- /docs/examples/cards/card-with-no-link.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link 4 | figmaLink: 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardbase--read-only 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | title: 'Orthopaedic appointment', 13 | titleClasses: 'nhsuk-u-font-size-22', 14 | descriptionHtml: ' 15 |

    Monday 3 June 2024
    9:40am

    16 |

    The Willows, Croydon University Hospital

    17 | ' 18 | }) }} 19 | -------------------------------------------------------------------------------- /docs/page-not-found.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/base.njk 3 | title: Page not found 4 | permalink: /404.html 5 | eleventyExcludeFromCollections: true 6 | --- 7 | 8 |
    9 |
    10 | 11 |

    We cannot find the page you're looking for

    12 | 13 |

    Please check the web address to make sure it was correct.

    14 | 15 |

    You can also browse the NHS App design system homepage.

    16 | 17 |

    If you think this link is broken, please contact the NHS App design system team.

    18 | 19 |
    20 |
    -------------------------------------------------------------------------------- /docs/components/header.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Header (web) 4 | description: Use the header at the top of every web browser page, to show users they are using NHS App services. 5 | backlogID: 18 6 | tags: 7 | - component 8 | --- 9 | 10 | ## How to use 11 | 12 | We extend the [NHS design system header](https://service-manual.nhs.uk/design-system/components/header) with added `nhsapp-u-hide-from-tablet` and `nhsapp-u-hide-until-tablet` modifier classes to show and hide nav items. 13 | 14 | ### Header (logged in) 15 | 16 | {% example "header/header-logged-in.njk" %} 17 | 18 | ### Header (logged out) 19 | 20 | {% example "header/header-not-logged-in.njk" %} 21 | -------------------------------------------------------------------------------- /docs/community/help-and-feedback.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/community.njk 3 | title: Help and feedback 4 | order: 1 5 | description: The NHS App design system team provides support for users of the NHS App design resources. Contact us to ask for help or to provide feedback. 6 | tags: 7 | - community 8 | help: no 9 | --- 10 | 11 | ## Contact us on Slack 12 | 13 | The team monitors the following channels and provides support. If you have any questions or feedback, get in touch via Slack. 14 | 15 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 16 | 17 | If you mention the handle `@nhsapp-design-system-team`, it will notify all members of the team. 18 | -------------------------------------------------------------------------------- /src/styles/icon/_icons.scss: -------------------------------------------------------------------------------- 1 | @use "nhsuk-frontend/dist/nhsuk/core/settings/colours-applied" as *; 2 | @use "nhsuk-frontend/dist/nhsuk/core/helpers/colour" as *; 3 | @use "nhsuk-frontend/dist/nhsuk/core/tools/sass-mq" as *; 4 | 5 | .nhsapp-icon { 6 | fill: $nhsuk-link-colour; // Set default icon colour to NHS blue 7 | 8 | &--unread-indicator { 9 | fill: nhsuk-colour("red"); 10 | stroke: nhsuk-colour("white"); 11 | } 12 | } 13 | 14 | .nhsapp-icon--black { 15 | fill: nhsuk-colour("black"); 16 | } 17 | 18 | .nhsapp-icon--32 { 19 | height: 32px; 20 | width: 32px; 21 | 22 | @include nhsuk-media-query($until: tablet) { 23 | height: 24px; 24 | width: 24px; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/_data/redirects.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Redirects configuration (auto-loaded by Eleventy because it is in docs/_data) 3 | * Each object needs a leading and trailing slash on `from` so the generated 4 | * permalink produces /path/index.html 5 | */ 6 | export default [ 7 | { 8 | from: '/components/panel/', 9 | to: 'https://service-manual.nhs.uk/design-system/components/panel' 10 | }, 11 | { 12 | from: '/patterns/confirmation-page/', 13 | to: 'https://service-manual.nhs.uk/design-system/patterns/confirmation-page' 14 | }, 15 | { 16 | from: '/get-started/github-and-heroku/', 17 | to: '/get-started/nhsapp-prototype/' 18 | } 19 | // Add more redirects here as needed 20 | ] 21 | -------------------------------------------------------------------------------- /docs/components/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | isIndex: true 4 | title: Components 5 | description: Design components solve common problems so teams can focus on the things unique to their service and its users. 6 | --- 7 | 8 | Use these components in addition to those in the [NHS design system](https://service-manual.nhs.uk/design-system). 9 | 10 | ## Iterating a component 11 | 12 | Use existing components as starting points, but you may need to iterate them to meet user needs for particular services. 13 | 14 | Before iterating a component make sure there is a clear user need to do so. 15 | 16 | [Share any changes you make or research findings](/community/share-findings/) in the NHS App design system backlog. 17 | -------------------------------------------------------------------------------- /src/assets/icons/messages-unread-filled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-with-badge.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link with description 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardlink--with-badge 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | 11 | {{ nhsappCard({ 12 | title: 'Hospital appointments', 13 | href: '#', 14 | linkAriaLabel: 'Hospital appointments, you have 1 new notification', 15 | badgeLarge: { 16 | count: 1, 17 | attributes: { 18 | 'aria-hidden': 'true' 19 | } 20 | } 21 | }) }} 22 | -------------------------------------------------------------------------------- /docs/examples/page-not-found/web.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-web.njk 3 | title: Page not found - web 4 | figmaLink: 5 | vueLink: 6 | --- 7 | 8 |
    9 |
    10 | 11 |

    Page not found

    12 | 13 |

    If you typed the web address, check it was correct.

    14 | 15 |

    If you pasted the web address, check you copied the entire address.

    16 | 17 |

    Otherwise, this may be a broken link that we will fix as soon as possible. Try again later or use a different service.

    18 | 19 |

    For urgent medical advice, use 111 online or call 111.

    20 | 21 |
    22 |
    23 | -------------------------------------------------------------------------------- /docs/patterns/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/pattern.njk 3 | isIndex: true 4 | title: Patterns 5 | description: Patterns are tested and agreed solutions to common needs. 6 | --- 7 | 8 | Patterns often use one or more [components](/components/) and explain how to adapt them to the context. 9 | 10 | Use these patterns in addition to those in the [NHS design system](https://service-manual.nhs.uk/design-system). 11 | 12 | ## Iterating a pattern 13 | 14 | Use existing patterns as starting points, but you may need to iterate them to meet user needs for particular services. 15 | 16 | Before iterating a pattern make sure there is a clear user need to do so. 17 | 18 | [Share any changes you make or research findings](/community/share-findings/) in the NHS App design system backlog. 19 | -------------------------------------------------------------------------------- /src/assets/icons/cross.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/header-native.njk: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/top-nav-native.njk: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 19 |
    20 |
    -------------------------------------------------------------------------------- /docs/components/buttons.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Buttons 4 | description: Use buttons to help users to carry out an action. 5 | backlogID: 12 6 | tags: 7 | - component 8 | --- 9 | 10 | ## How to use 11 | 12 | We extend the [NHS design system button](https://service-manual.nhs.uk/design-system/components/buttons) with the `nhsapp-button` modifier class so that its border radius matches the [card links](/components/card-links). 13 | 14 | ### Primary button 15 | 16 | {% example "buttons/button-primary.njk" %} 17 | 18 | ### Secondary button 19 | 20 | {% example "buttons/button-secondary.njk" %} 21 | 22 | ### Buttons on dark backgrounds (reverse button) 23 | 24 | {% example "buttons/button-reverse.njk" %} 25 | 26 | ### Warning button 27 | 28 | {% example "buttons/button-warning.njk" %} 29 | -------------------------------------------------------------------------------- /docs/_includes/layouts/plain.njk: -------------------------------------------------------------------------------- 1 | {% extends "./base.njk" %} 2 | 3 | {% block beforeContent %} 4 | {{ breadcrumb({ 5 | href: "/", 6 | text: "Home" 7 | }) }} 8 | {% endblock %} 9 | 10 | {% block container %} 11 |
    12 |
    13 |
    14 |
    15 | {% block main %} 16 |

    17 | {{ title }} 18 |

    19 |

    {{ description }}

    20 | {{ content | safe }} 21 | {% endblock %} 22 |
    23 |
    24 |
    25 |
    26 | {% endblock %} -------------------------------------------------------------------------------- /docs/examples/error-pages/update-app.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile-not-logged-in.njk 3 | mobile: true 4 | mobileHeader: blue 5 | title: Error page - Update NHS App 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'button/macro.njk' import button %} 11 | 12 |
    13 |
    14 | 15 |

    Update the NHS App to continue

    16 | 17 |

    You will not be able to use it until you do.

    18 | 19 |

    For urgent medical advice, use 111 online or call 111.

    20 | 21 | {{ button({ 22 | text: 'Update the NHS App', 23 | classes: 'nhsuk-button--secondary nhsapp-button nhsuk-u-margin-top-3' 24 | }) }} 25 | 26 |
    27 |
    -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/header-web.njk: -------------------------------------------------------------------------------- 1 | {{ header({ 2 | logo: { 3 | href: "/", 4 | ariaLabel: "NHS App" 5 | }, 6 | navigation: { 7 | items: [ 8 | { 9 | href: "#", 10 | text: "Home" 11 | }, 12 | { 13 | href: '#', 14 | text: 'Services' 15 | }, 16 | { 17 | href: '#', 18 | text: 'Your health' 19 | }, 20 | { 21 | href: '#', 22 | text: 'Messages' 23 | }, 24 | { 25 | href: '#', 26 | text: 'Help and support' 27 | }, 28 | { 29 | href: '#', 30 | text: 'Account and settings' 31 | }, 32 | { 33 | href: '#', 34 | text: 'Sign out' 35 | } 36 | ] 37 | } 38 | }) }} -------------------------------------------------------------------------------- /src/assets/icons/filter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/heart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/css/_code-colours.scss: -------------------------------------------------------------------------------- 1 | // Prism JS colour overrides to make accessible 2 | 3 | .token.comment, 4 | .token.prolog, 5 | .token.doctype, 6 | .token.cdata { 7 | color: #595959; 8 | } 9 | 10 | .token.punctuation { 11 | color: #595959; 12 | } 13 | 14 | .token.selector, 15 | .token.attr-name, 16 | .token.string, 17 | .token.char, 18 | .token.builtin, 19 | .token.inserted { 20 | color: #558000; 21 | } 22 | 23 | .token.operator, 24 | .token.entity, 25 | .token.url, 26 | .language-css .token.string, 27 | .style .token.string { 28 | color: #9a6e3a; 29 | } 30 | 31 | .token.atrule, 32 | .token.attr-value, 33 | .token.keyword { 34 | color: #005d85; 35 | } 36 | 37 | .token.function, 38 | .token.class-name { 39 | color: #d93656; 40 | } 41 | 42 | .token.regex, 43 | .token.important, 44 | .token.variable { 45 | color: #a36a00; 46 | } 47 | -------------------------------------------------------------------------------- /src/settings/_colours-palette.scss: -------------------------------------------------------------------------------- 1 | @use "sass:color"; 2 | 3 | //// 4 | /// @group settings/colours 5 | //// 6 | 7 | /// NHS App colour palette (module version) 8 | /// 9 | /// @type Map 10 | /// 11 | /// @prop $colour - Representation for the given $colour, where $colour is the 12 | /// friendly name for the colour (e.g. "red": #ff0000); 13 | $nhsapp-colours: ( 14 | "pale-aqua-green": #c9e3e0, 15 | "dark-aqua-green": #1e403d, 16 | "pale-blue": #ccdff1, 17 | "dark-blue": #00386e, 18 | "pale-green": #cce5d8, 19 | "dark-green": #004c23, 20 | "pale-purple": #ded6e8, 21 | "dark-purple": #402463, 22 | "pale-orange": #fbe8cc, 23 | "dark-orange": #5f3800, 24 | "pale-pink": #efd3e3, 25 | "dark-pink": #681645, 26 | "pale-red": #f7d4d1, 27 | "dark-red": #801810, 28 | "pale-yellow": #fff7b1, 29 | "dark-yellow": #4c4612 30 | ) !default; 31 | -------------------------------------------------------------------------------- /src/components/badge/large/macro-options.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | Name | Type | Required | Description | 4 | | ---------- | ------ | -------- | ------------------------------------------------------------------------ | 5 | | count | number | yes | Number for the large badge. Badge appears only when `count > 0`. | 6 | | label | string | yes | Visually hidden text read after the number (for example `new messages`). | 7 | | id | string | no | ID attribute for the badge. | 8 | | classes | string | no | Classes for the badge. | 9 | | attributes | object | no | HTML attributes for the badge (e.g. `data-*`, `aria-*`). | 10 | -------------------------------------------------------------------------------- /docs/examples/error-pages/check-internet-connection.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile-not-logged-in.njk 3 | mobile: true 4 | mobileHeader: blue 5 | title: Error page - Check internet connection 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'button/macro.njk' import button %} 11 | 12 |
    13 |
    14 | 15 |

    Check your internet connection

    16 | 17 |

    Try using wifi or move to a place with better internet connection.

    18 | 19 |

    If you still cannot connect to the internet and need urgent medical advice, call 111.

    20 | 21 | {{ button({ 22 | text: 'Try again', 23 | classes: 'nhsuk-button--secondary nhsapp-button nhsuk-u-margin-top-3' 24 | }) }} 25 | 26 |
    27 |
    -------------------------------------------------------------------------------- /docs/examples/cards/card-link.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhscardlink--docs 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | cards: [ 15 | { 16 | title: 'GP health record', 17 | href: '#' 18 | }, 19 | { 20 | title: 'View and manage prescriptions', 21 | href: '#' 22 | }, 23 | { 24 | title: 'Upcoming and past appointments', 25 | href: '#' 26 | } 27 | ] 28 | }) }} -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/feedback-section.njk: -------------------------------------------------------------------------------- 1 | {% if tags and ("page" in tags or "helpUsers" in tags or "component" in tags or "style" in tags) %} 2 | 3 |

    Help improve {% if tags and ("component" in tags) %}this component{% elif tags and ("style" in tags) %}these styles{% else %}this pattern{% endif %}

    4 | 5 |

    The NHS App design system team would like to hear:

    6 | 7 | 11 | 12 |

    Add these comments to the '{{ title }}' discussion on GitHub.

    13 | 14 | {% endif %} 15 | -------------------------------------------------------------------------------- /docs/examples/timeline/timeline-active.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Timeline active 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=4453-2405&t=sIan6GZfBz3Z5bOy-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhstimeline--docs 6 | arguments: timeline 7 | --- 8 | 9 | {% from 'nhsapp/components/timeline/macro.njk' import nhsappTimeline %} 10 | 11 | {{ nhsappTimeline({ 12 | items: [ 13 | { 14 | headingText: 'Date referred', 15 | isPastItem: true, 16 | text: '8 June 2024' 17 | }, 18 | { 19 | headingText: 'Current status', 20 | active: true, 21 | text: 'Waiting for treatment' 22 | }, 23 | { 24 | headingText: 'Estimated treatment start date', 25 | text: 'September 2024' 26 | } 27 | ] 28 | }) }} 29 | -------------------------------------------------------------------------------- /docs/assets/css/components/_top-nav-native.scss: -------------------------------------------------------------------------------- 1 | .app-top-nav-native { 2 | background-color: nhsuk-colour("grey-5"); 3 | position: fixed; 4 | width: 100%; 5 | z-index: 1; 6 | } 7 | 8 | .app-top-nav-native__nav { 9 | align-items: flex-start; 10 | display: flex; 11 | justify-content: flex-end; 12 | } 13 | 14 | .app-top-nav-native__nav-list { 15 | display: flex; 16 | list-style: none; 17 | margin: 0 -12px 0 0; 18 | padding: 0; 19 | } 20 | 21 | .app-top-nav-native__nav-item { 22 | line-height: 1; 23 | margin: 0; 24 | padding: 0; 25 | } 26 | 27 | .app-top-nav-native__nav-link { 28 | display: block; 29 | padding: 12px; 30 | 31 | &:focus { 32 | background-color: transparent; 33 | box-shadow: none; 34 | } 35 | 36 | .nhsapp-icon { 37 | fill: $nhsuk-focus-text-colour; 38 | flex-shrink: 0; 39 | height: 32px; 40 | width: 32px; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-light-blue.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card account 4 | figmaLink: 5 | vueLink: 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | classes: 'nhsapp-cards--pale-blue', 15 | isListItem: false, 16 | cards: [ 17 | { 18 | title: 'Neil Dean', 19 | titleClasses: 'nhsuk-u-font-size-36', 20 | headingLevel: '2', 21 | descriptionHtml: '

    Date of birth: 15 March 1984

    22 |

    NHS number: 123 456 7890

    ' 23 | }, 24 | { 25 | title: 'Manage health services for others', 26 | href: '#' 27 | } 28 | ] 29 | }) }} 30 | -------------------------------------------------------------------------------- /docs/_includes/layouts/example-full-page-mobile.njk: -------------------------------------------------------------------------------- 1 | --- 2 | htmlAttributes: 3 | class: app-html-background-colour-grey-5 4 | --- 5 | 6 | {% extends "./base.njk" %} 7 | 8 | {% block skiplink %}{% endblock %} 9 | 10 | {% set containerClasses = "app-width-container" %} 11 | {% set mainClasses = "app-main-wrapper" %} 12 | 13 | {% block header %} 14 | {% include "layouts/partials/top-nav-native.njk" %} 15 | {% endblock %} 16 | 17 | {% block footer %} 18 | {% include "layouts/partials/bottom-nav-native.njk" %} 19 | {% endblock %} 20 | 21 | {% block beforeContent %} 22 | {% if backlink %} 23 | {{ backLink({ 24 | href: backLinkHref | default("#"), 25 | text: backLinkText | default("Back"), 26 | classes: "nhsuk-u-margin-top-0 nhsuk-u-margin-bottom-4" 27 | }) }} 28 | {% endif %} 29 | {% endblock %} 30 | 31 | {% block content %} 32 | {{ content | safe }} 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /docs/examples/cards/card-group-stacked.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardgroup--unstacked 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | cards: [ 15 | { 16 | title: 'GP health record', 17 | href: '#' 18 | }, 19 | { 20 | title: 'View and manage prescriptions', 21 | href: '#' 22 | }, 23 | { 24 | title: 'Upcoming and past appointments', 25 | href: '#' 26 | } 27 | ] 28 | }) }} 29 | -------------------------------------------------------------------------------- /docs/community/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/community.njk 3 | title: Community 4 | --- 5 | 6 | The NHS App design system helps us learn from each other, share knowledge and reuse as much as possible. 7 | 8 | Anyone can contribute. You just need a GitHub account. 9 | 10 | ## How to use GitHub 11 | 12 | GitHub is an online platform. We use it for community collaboration and hosting code. 13 | 14 | If you do not have one already, [create a GitHub account for free](https://github.com/signup). 15 | 16 | On one level, you can simply use GitHub like an online forum. You can take part in conversations and leave comments. 17 | 18 | You can also use GitHub for more advanced tasks. This includes storing prototypes and proposing changes to the design system. [Following the GitHub tutorial](https://docs.github.com/en/get-started/start-your-journey/hello-world) can help you learn more about the GitHub workflows used in such tasks. 19 | -------------------------------------------------------------------------------- /docs/examples/timeline/timeline-inactive.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Timeline active 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=4453-2405&t=sIan6GZfBz3Z5bOy-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhstimeline--docs 6 | arguments: timeline 7 | --- 8 | 9 | {% from 'nhsapp/components/timeline/macro.njk' import nhsappTimeline %} 10 | 11 | {{ nhsappTimeline({ 12 | items: [ 13 | { 14 | headingText: 'Await approval', 15 | text: 'The request will either be approved or rejected. If rejected please contact your Healthcare Professional.', 16 | active: true 17 | }, 18 | { 19 | headingText: 'GP Approval Process', 20 | text: 'Once approved, it can take 3 to 5 working days for a nominated pharmacy to prepare your prescription.' 21 | } 22 | ] 23 | }) }} 24 | -------------------------------------------------------------------------------- /docs/examples/error-pages/manage-services.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | title: Error page - Could not show people you manage services for 5 | figmaLink: 6 | vueLink: 7 | --- 8 | 9 |
    10 |
    11 | 12 |

    We could not show details of people you manage services for

    13 | 14 |

    Try again later, or contact the GP surgery of the person whose services you were trying to access.

    15 | 16 |

    If the problem continues

    17 | 18 |

    Make a note of the error code 3e6294 and then contact the NHS App team.

    19 | 20 |
    21 | Go to home 22 |
    23 | 24 |
    25 |
    -------------------------------------------------------------------------------- /src/assets/icons/letter.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docs/assets/js/copy.js: -------------------------------------------------------------------------------- 1 | const Copy = function (button) { 2 | this.button = button 3 | 4 | // If the browser supports the Clipboard API, show the copy button 5 | if (navigator.clipboard) { 6 | this.button.classList.remove('app-u-hidden') 7 | } 8 | 9 | button.addEventListener('click', (e) => this.handleCopyClick(e)) 10 | } 11 | 12 | Copy.prototype.handleCopyClick = function (e) { 13 | e.preventDefault() 14 | const copyFrom = this.button.getAttribute('data-clipboard-target') 15 | const str = document.querySelector(copyFrom).innerText 16 | navigator.clipboard.writeText(str) 17 | 18 | // Change the button text to "Copied" for 5 seconds 19 | const originalText = this.button.innerText 20 | this.button.innerText = 'Copied' 21 | setTimeout(() => { 22 | this.button.innerText = originalText 23 | }, 5000) 24 | } 25 | 26 | document 27 | .querySelectorAll('[data-module="app-copy"]') 28 | .forEach(function (element) { 29 | new Copy(element) 30 | }) 31 | -------------------------------------------------------------------------------- /docs/community/propose-components-or-patterns.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/community.njk 3 | title: Propose a component or pattern 4 | order: 1 5 | description: 6 | tags: 7 | - contribution 8 | --- 9 | 10 | Check what components and patterns are in progress using the [NHS App components and patterns backlog](https://github.com/orgs/nhsuk/projects/8). 11 | 12 | ## If your idea is on the backlog 13 | 14 | You can contribute to the GitHub thread and: 15 | 16 | - add examples or evidence you have to support the proposal 17 | - ask to work on the proposal 18 | 19 | ## If your idea is not on the backlog 20 | 21 | Propose a new component or pattern using the [GitHub issue template](https://github.com/nhsuk/nhsapp-frontend/issues/new?assignees=&labels=type%3A+feature+request%2C+awaiting+triage&projects=&template=new_feature.yaml&title=%5BFeature+request%5D%3A+). 22 | 23 | Describe your idea and give evidence of user needs. The design system team will respond and discuss the idea with you. 24 | -------------------------------------------------------------------------------- /docs/examples/sub-hub-pages/care-plans.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Your health 5 | title: Care plans 6 | backlink: true 7 | figmaLink: 8 | vueLink: 9 | --- 10 | 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 12 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 13 | 14 |
    15 |
    16 | 17 |

    Care plans

    18 |

    Check plans you've agreed with your health team about how you want to be cared for

    19 | 20 | {{ nhsappCardGroup({ 21 | stacked: true, 22 | cards: [ 23 | { 24 | title: 'Manage your health care plans', 25 | href: '#' 26 | }, 27 | { 28 | title: 'View your universal health care plan', 29 | href: '#' 30 | } 31 | ] 32 | }) }} 33 | 34 |
    35 |
    -------------------------------------------------------------------------------- /docs/examples/cards/card-group-headings.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link 4 | figmaLink: 5 | vueLink: 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | heading: 'Your GP services', 15 | cards: [ 16 | { 17 | title: 'Request repeat prescriptions', 18 | href: '#' 19 | }, 20 | { 21 | title: 'Contact your GP surgery for a document or update', 22 | href: '#' 23 | }, 24 | { 25 | title: 'Check for available GP appointments', 26 | href: '#' 27 | } 28 | ] 29 | }) }} 30 | 31 | {{ nhsappCardGroup({ 32 | stacked: true, 33 | heading: 'Other NHS services', 34 | cards: [ 35 | { 36 | title: 'Book', 37 | href: '#' 38 | }, 39 | { 40 | title: 'Request prescriptions', 41 | href: '#' 42 | } 43 | ] 44 | }) }} 45 | -------------------------------------------------------------------------------- /.github/workflows/docs.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy Docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: '20' 16 | - run: npm ci 17 | - run: npm run docs:build 18 | - uses: actions/upload-pages-artifact@v3 19 | with: 20 | path: 'dist/docs' 21 | deploy: 22 | needs: build 23 | 24 | # Grant GITHUB_TOKEN the permissions required to make a Pages deployment 25 | permissions: 26 | pages: write # to deploy to Pages 27 | id-token: write # to verify the deployment originates from an appropriate source 28 | 29 | environment: 30 | name: github-pages 31 | url: ${{ steps.deployment.outputs.page_url }} 32 | 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Deploy to GitHub Pages 36 | id: deployment 37 | uses: actions/deploy-pages@v4 38 | -------------------------------------------------------------------------------- /docs/patterns/page-not-found.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/pattern.njk 3 | title: Page not found pages 4 | description: Tell users we cannot find the page they were trying to view. They are also known as 404 pages. 5 | backlogID: 260 6 | --- 7 | 8 | ## When to use 9 | 10 | Use a page not found page if someone is trying to view a page that does not exist. 11 | 12 | ## How to use 13 | 14 | In the native NHS App, this error only happens if someone selects a button or link leading to a page that does not exist. It means we need to fix the link. 15 | 16 | {% example "page-not-found/native.njk" %} 17 | 18 | If someone is accessing NHS App services in a web browser, this error can also happen if they: 19 | 20 | - type or copy a web address for a page that does not exist 21 | - type or copy a web address incorrectly 22 | 23 | {% example "page-not-found/web.njk" %} 24 | 25 | The page should have: 26 | 27 | - ‘Page not found – NHS App’ as the page title 28 | - ‘Page not found’ as the H1 29 | - details of how to get urgent medical advice 30 | -------------------------------------------------------------------------------- /docs/examples/cards/card-group-custom-heading.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link group with custom heading 4 | figmaLink: 5 | vueLink: 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | headingHtml: '
    15 |

    Services

    16 | View all services 17 |
    ', 18 | cards: [ 19 | { 20 | title: 'Request repeat prescriptions', 21 | href: '#' 22 | }, 23 | { 24 | title: 'Check if you need urgent medical help using 111 online', 25 | href: '#' 26 | } 27 | ] 28 | }) }} -------------------------------------------------------------------------------- /docs/examples/hub-pages/account.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Account 5 | title: Account 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 12 | {% from 'button/macro.njk' import button %} 13 | 14 |
    15 |
    16 | 17 |

    Account

    18 | 19 | {{ nhsappCardGroup({ 20 | stacked: true, 21 | cards: [ 22 | { 23 | title: 'Manage services for another person', 24 | href: '#' 25 | }, 26 | { 27 | title: 'Settings', 28 | href: '#' 29 | }, 30 | { 31 | title: 'Help and support', 32 | href: '#' 33 | } 34 | ] 35 | }) }} 36 | 37 | {{ button({ 38 | text: 'Log out', 39 | classes: 'nhsuk-button--secondary nhsapp-button' 40 | }) }} 41 | 42 |
    43 |
    -------------------------------------------------------------------------------- /docs/examples/error-pages/confirmed-prescriptions.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | title: Error page - Confirmed prescriptions 5 | hub: Your health 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | {% from 'button/macro.njk' import button %} 12 | 13 |
    14 |
    15 | 16 |

    We could not show your confirmed prescriptions

    17 | 18 |

    Contact your GP or pharmacy if you need help with a prescription.

    19 | 20 |

    Other options in the NHS App

    21 | 22 | {{ nhsappCard({ 23 | title: 'Request an emergency prescription using 111 online', 24 | href: '#', 25 | classes: 'nhsapp-card--secondary' 26 | }) }} 27 | 28 | 31 | 32 |
    33 |
    -------------------------------------------------------------------------------- /docs/examples/cards/card-group-stacked-secondary.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link secondary stacked 4 | figmaLink: https://www.figma.com/design/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?node-id=128-7303&t=Bvw33PoP6TmBpN41-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/story/components-nhscardgroup--stacked 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | stacked: true, 14 | cards: [ 15 | { 16 | title: 'Login and security', 17 | href: '#' 18 | }, 19 | { 20 | title: 'Face ID', 21 | href: '#' 22 | } 23 | ] 24 | }) }} 25 | 26 | {{ nhsappCardGroup({ 27 | stacked: true, 28 | classes: 'nhsapp-cards--secondary', 29 | cards: [ 30 | { 31 | title: 'Privacy and legal policies', 32 | href: '#' 33 | }, 34 | { 35 | title: 'Join our user research panel', 36 | href: '#' 37 | } 38 | ] 39 | }) }} -------------------------------------------------------------------------------- /src/assets/icons/help.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/switch-profile.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 NHS England 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/examples/error-pages/show-gp-appointments.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | title: Error page - Show GP appointments 5 | hub: Your health 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'button/macro.njk' import button %} 11 | 12 |
    13 |
    14 | 15 |

    We could not show your GP appointments

    16 | 17 |

    Try loading GP appointments again.

    18 | 19 |

    If the problem continues

    20 | 21 |

    Contact your GP surgery directly if you need to book or change an appointment now.

    22 | 23 |

    For urgent medical advice, use 111 online or call 111.

    24 | 25 | {{ button({ 26 | text: 'Try again', 27 | classes: 'nhsuk-button--secondary nhsapp-button nhsuk-u-margin-top-3' 28 | }) }} 29 | 30 |
    31 | Go to appointments 32 |
    33 | 34 |
    35 |
    -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish to NPM 2 | on: 3 | release: 4 | types: 5 | - published 6 | jobs: 7 | publish: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: write 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: '20' 16 | registry-url: 'https://registry.npmjs.org' 17 | - name: Install dependencies 18 | run: npm ci 19 | 20 | - name: Build release package 21 | run: npm run release 22 | 23 | - name: Get package version 24 | id: get_version 25 | run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT 26 | 27 | - name: Release 28 | uses: softprops/action-gh-release@v1 29 | if: startsWith(github.ref, 'refs/tags/') 30 | with: 31 | files: ./dist/nhsapp-frontend-${{ steps.get_version.outputs.VERSION }}.zip 32 | 33 | - name: Publish NPM package 34 | run: npm publish --access public 35 | env: 36 | NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} 37 | IS_PRERELEASE: ${{ github.event.release.prerelease }} 38 | -------------------------------------------------------------------------------- /src/components/summary-list/_index.scss: -------------------------------------------------------------------------------- 1 | @use "nhsuk-frontend/dist/nhsuk/core/tools/sass-mq" as *; 2 | @use "nhsuk-frontend/dist/nhsuk/core/tools/spacing" as *; 3 | @use "nhsuk-frontend/dist/nhsuk/core/settings/colours-applied" as *; 4 | 5 | .nhsapp-summary-list { 6 | // Override the NHS UK Frontend summary list component to display two columns on mobile 7 | &--two-columns-mobile { 8 | @include nhsuk-media-query($until: tablet) { 9 | display: table; 10 | table-layout: fixed; 11 | width: 100%; 12 | } 13 | 14 | .nhsuk-summary-list__key, 15 | .nhsuk-summary-list__value, 16 | .nhsuk-summary-list__actions { 17 | border-bottom: 1px solid $nhsuk-border-colour; 18 | display: table-cell; 19 | padding-bottom: nhsuk-spacing(2); 20 | padding-right: nhsuk-spacing(4); 21 | padding-top: nhsuk-spacing(2); 22 | } 23 | 24 | .nhsuk-summary-list__row { 25 | display: table-row; 26 | } 27 | 28 | .nhsuk-summary-list__key { 29 | @include nhsuk-media-query($until: tablet) { 30 | width: 50%; 31 | } 32 | } 33 | 34 | .nhsuk-summary-list__value { 35 | width: 50%; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/redirects.11ty.js: -------------------------------------------------------------------------------- 1 | // Generate static HTML redirect pages from redirects global data 2 | // Each entry in redirects.js becomes a directory with an index.html performing the redirect. 3 | 4 | export const data = { 5 | pagination: { 6 | data: 'redirects', 7 | size: 1, 8 | alias: 'redirect' 9 | }, 10 | eleventyExcludeFromCollections: true, 11 | // Use the provided from path (must include leading slash and trailing slash) so Eleventy outputs /path/index.html 12 | permalink: ({ redirect }) => redirect.from 13 | } 14 | 15 | export function render({ redirect }) { 16 | const target = redirect.to 17 | return ` 18 | 19 | 20 | 21 | Redirecting... 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

    This page has moved to ${target}.

    30 | 31 | ` 32 | } 33 | -------------------------------------------------------------------------------- /src/assets/icons/download.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docs/get-started/nhsapp-frontend.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/get-started.njk 3 | title: NHS App frontend 4 | tags: 5 | - production 6 | --- 7 | 8 | The [NHS App frontend](https://github.com/nhsuk/nhsapp-frontend) is a CSS library built on top of the [NHS.UK frontend](https://github.com/nhsuk/nhsuk-frontend). It provides NHS App-specific styles and [components](/components). 9 | 10 | This guide explains how to set up the NHS App frontend in production. 11 | 12 | ## Before you start 13 | 14 | Before you begin, make sure you have followed the [NHS design system production setup guide](https://service-manual.nhs.uk/design-system/production). 15 | 16 | ## Include the NHS App frontend in your project 17 | 18 | To start using NHS App styles, components, and patterns, you need to add the NHS App frontend to your project. 19 | 20 | ### Install using npm 21 | 22 | We recommend [installing the NHS App frontend using npm](/get-started/installing-with-npm/). This option lets you: 23 | 24 | - select which component CSS to include 25 | - build your own styles or components using the palette, typography, and spacing mixins 26 | - customise the build, such as overriding colours or enabling global styles 27 | - use the component Nunjucks templates 28 | -------------------------------------------------------------------------------- /src/assets/icons/night.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docs/_includes/layouts/nhsapp-prototype.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Get started" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | }, 18 | { 19 | href: "/get-started", 20 | text: "Get started" 21 | } 22 | ], 23 | href: "/get-started/nhsapp-prototype", 24 | text: "NHS App prototype" 25 | }) }} 26 | {% endif %} 27 | {% endblock %} 28 | 29 | {% set sidebar %} 30 | {{ appSideNavigation({ 31 | label: 'NHS App prototype', 32 | currentPath: page.url, 33 | sections: [ 34 | { 35 | heading: { 36 | text: 'NHS App prototype' 37 | }, 38 | items: collections.nhsappPrototype | sort(attribute="data.order") 39 | } 40 | ] 41 | }) }} 42 | {% endset %} 43 | 44 | {% block content %} 45 | NHS App prototype 46 |

    47 | {{ title }} 48 |

    49 | {{ content | safe }} 50 | 51 | {% endblock %} 52 | -------------------------------------------------------------------------------- /src/components/tag/macro-options.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | Name | Type | Required | Description | 4 | | ---------- | ------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- | 5 | | text | string | conditional | If `html` is set, this is not required. Text to use within the tag component. If `html` is provided, the `text` argument will be ignored. | 6 | | html | string | conditional | If `text` is set, this is not required. HTML to use within the tag component. If `html` is provided, the `text` argument will be ignored. | 7 | | id | string | no | The ID of the tag. | 8 | | classes | string | no | Classes to add to the tag. | 9 | | attributes | object | no | HTML attributes for the tag (e.g. `data-*`, `aria-*`). | 10 | -------------------------------------------------------------------------------- /docs/_includes/layouts/style.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Styles" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | } 18 | ], 19 | href: "/styles", 20 | text: "Styles" 21 | }) }} 22 | {% endif %} 23 | {% endblock %} 24 | 25 | {% set sidebar %} 26 | {{ appSideNavigation({ 27 | label: 'Styles', 28 | currentPath: page.url, 29 | sections: [ 30 | { 31 | heading: { 32 | text: 'Styles' 33 | }, 34 | items: collections.style | sort(attribute="data.title") 35 | } 36 | ] 37 | }) }} 38 | {% endset %} 39 | 40 | {% block content %} 41 | {% if tags and "style" in tags %} 42 | Styles 43 | {% endif %} 44 |

    45 | {{ title }} 46 |

    47 |

    {{ description }}

    48 | {{ content | safe }} 49 | {% if tags and "style" in tags %} 50 | {% include "layouts/partials/feedback-section.njk" %} 51 | {% endif %} 52 | 53 | {% endblock %} 54 | -------------------------------------------------------------------------------- /src/assets/icons/clock.svg: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-accessibility.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link accessibility 4 | figmaLink: https://www.figma.com/file/6f2CbcZ7cnpNrtKEcfQp8X/NHS-App-Design-System?type=design&node-id=128%3A7303&mode=design&t=DLiyCHcTTAYkEDa0-1 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhscardbase--docs 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | {% from 'nhsapp/components/tag/macro.njk' import nhsappTag %} 11 | 12 | {% set tag %} 13 | {{ nhsappTag({ 14 | text: 'Action needed', 15 | classes: 'nhsapp-tag--red nhsuk-u-margin-bottom-3', 16 | attributes: { 17 | 'aria-hidden': 'true' 18 | } 19 | }) }} 20 | {% endset %} 21 | 22 | {{ nhsappCard({ 23 | title: 'Orthopaedic appointment', 24 | href: '#', 25 | titleClasses: 'nhsuk-u-font-size-22', 26 | linkAriaLabel: 'Action needed: Orthopaedic appointment on Monday 3 June 2024 at 9:40am, at The Willows, Croydon University Hospital', 27 | descriptionHtml: ' 28 | 29 | 30 | ', 31 | aboveContent: { html: tag } 32 | }) }} 33 | -------------------------------------------------------------------------------- /docs/_includes/layouts/sidebar.njk: -------------------------------------------------------------------------------- 1 | {% extends "./base.njk" %} 2 | 3 | {% block main %} 4 |
    5 | {% block beforeContent %}{% endblock %} 6 |
    7 |
    8 | {% block sidebar_desktop %} 9 |
    10 | {{ sidebar | safe }} 11 |
    12 | {% endblock %} 13 |
    14 | 15 |
    16 |
    17 | {% block content %} 18 | {{ content | safe }} 19 | {% endblock content %} 20 |
    21 | 22 | {# Sidebar nav is at the bottom for mobile #} 23 | {% block sidebar_mobile %} 24 |
    25 | {{ sidebar | safe }} 26 |
    27 | {% endblock %} 28 | 29 | {% if help === "no" %} 30 | {% else %} 31 | {% include "layouts/partials/get-help.njk" %} 32 |
    33 | {% endif %} 34 | 35 | {% include "layouts/partials/propose-change.njk" %} 36 | 37 |
    38 |
    39 |
    40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /docs/assets/css/components/_bottom-nav-native.scss: -------------------------------------------------------------------------------- 1 | .app-bottom-nav-native { 2 | background-color: $nhsuk-link-colour; 3 | bottom: 0; 4 | padding-bottom: 8px; 5 | position: fixed; 6 | left: 0; 7 | width: 100%; 8 | } 9 | 10 | .app-bottom-nav-native__list { 11 | display: flex; 12 | gap: nhsuk-spacing(1); 13 | list-style: none; 14 | margin: 0; 15 | padding: 0 10px; 16 | width: 100%; 17 | } 18 | 19 | .app-bottom-nav-native__item { 20 | line-height: 1; 21 | margin: 0; 22 | padding: 0; 23 | width: 25%; 24 | } 25 | 26 | .app-bottom-nav-native__link { 27 | align-items: center; 28 | display: flex; 29 | flex-direction: column; 30 | gap: nhsuk-spacing(2); 31 | padding: 12px 0 20px; 32 | text-decoration: none; 33 | 34 | .app-icon { 35 | fill: nhsuk-colour("white"); 36 | height: 28px; 37 | width: 28px; 38 | } 39 | 40 | .nhsapp-icon { 41 | fill: nhsuk-colour("white"); 42 | height: 28px; 43 | width: 28px; 44 | } 45 | 46 | &:focus { 47 | background-color: transparent; 48 | box-shadow: none; 49 | } 50 | } 51 | 52 | .app-bottom-nav-native__label { 53 | color: nhsuk-colour("white"); 54 | font-size: 12px; 55 | 56 | @include nhsuk-media-query($from: tablet) { 57 | font-size: 16px; 58 | } 59 | } 60 | 61 | .app-bottom-nav-native__label--active { 62 | font-weight: bold; 63 | } 64 | -------------------------------------------------------------------------------- /docs/_includes/layouts/partials/side-navigation.njk: -------------------------------------------------------------------------------- 1 | {% macro appSideNavigation(params) %} 2 | 23 | {% endmacro %} 24 | -------------------------------------------------------------------------------- /docs/community/suggest-a-change.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/community.njk 3 | title: Suggest improvements to the design system 4 | order: 4 5 | description: Let us know if you find an opportunity to fix or improve the NHS App design system. 6 | tags: 7 | - contribution 8 | --- 9 | 10 | This could include problems with the design or code of a component, or missing documentation and features. 11 | 12 | Post your feedback on the relevant GitHub issue. Use a: 13 | 14 | - [bug report](https://github.com/nhsuk/nhsapp-frontend/issues/new?assignees=&labels=type%3A+bug%2C+awaiting+triage&projects=&template=bug_report.yaml&title=%5BBug%5D%3A+) if something isn’t working as expected 15 | - [design defect](https://github.com/nhsuk/nhsapp-frontend/issues/new?assignees=&labels=type%3A+bug%2C+awaiting+triage&projects=&template=design_defect.yaml&title=%5BBug%5D%3A+) if there is a visual design issue 16 | - [documentation](https://github.com/nhsuk/nhsapp-frontend/issues/new?assignees=&labels=type%3A+documentation%2C+awaiting+triage&projects=&template=documentation.yaml&title=%5BDocumentation%5D%3A+) issue to suggest adding new documentation, or report missing, incorrect or unclear documentation 17 | - [feature request](https://github.com/nhsuk/nhsapp-frontend/issues/new?assignees=&labels=type%3A+feature+request%2C+awaiting+triage&projects=&template=new_feature.yaml&title=%5BFeature+request%5D%3A+) to suggest a new feature or idea 18 | -------------------------------------------------------------------------------- /docs/examples/sub-hub-pages/appointments.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Your health 5 | title: Appointments 6 | backlink: true 7 | figmaLink: 8 | vueLink: 9 | --- 10 | 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 12 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 13 | 14 |
    15 |
    16 | 17 |

    Upcoming and past appointments

    18 |

    View or manage upcoming and past appointments, referrals and waiting lists

    19 | 20 | {{ nhsappCardGroup({ 21 | stacked: true, 22 | cards: [ 23 | { 24 | title: 'GP surgery appointments', 25 | href: '#' 26 | }, 27 | { 28 | title: 'Referrals', 29 | href: '#' 30 | }, 31 | { 32 | title: 'Hospital appointments', 33 | href: '#', 34 | linkAriaLabel: 'Hospital appointments, you have 1 new notification', 35 | badgeLarge: { 36 | count: 1, 37 | label: 'notification', 38 | attributes: { 'aria-hidden': 'true' } 39 | } 40 | }, 41 | { 42 | title: 'Waiting list', 43 | href: '#' 44 | } 45 | ] 46 | }) }} 47 | 48 |
    49 |
    -------------------------------------------------------------------------------- /docs/examples/header/header-logged-in.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Header (web) logged in 4 | figmaLink: 5 | vueLink: 6 | --- 7 | 8 | {% from 'header/macro.njk' import header %} 9 | 10 | {{ header({ 11 | service: { 12 | text: 'App homepage' | safe, 13 | href: '#' 14 | }, 15 | account: { 16 | classes: 'nhsapp-u-hide-until-tablet', 17 | items: [ 18 | { 19 | text: 'Help and support', 20 | href: '#' 21 | }, 22 | { 23 | text: 'Account', 24 | href: '#' 25 | }, 26 | { 27 | text: 'Log out', 28 | href: '#' 29 | } 30 | ] 31 | }, 32 | navigation: { 33 | items: [ 34 | { 35 | text: 'Home', 36 | href: '#' 37 | }, 38 | { 39 | text: 'Services', 40 | href: '#' 41 | }, 42 | { 43 | text: 'Your health', 44 | href: '#' 45 | }, 46 | { 47 | text: 'Messages', 48 | href: '#' 49 | }, 50 | { 51 | text: 'Help and support', 52 | href: '#', 53 | classes: 'nhsapp-u-hide-from-tablet' 54 | }, 55 | { 56 | text: 'Account', 57 | href: '#', 58 | classes: 'nhsapp-u-hide-from-tablet' 59 | }, 60 | { 61 | text: 'Log out', 62 | href: '#', 63 | classes: 'nhsapp-u-hide-from-tablet' 64 | } 65 | ] 66 | } 67 | }) }} 68 | -------------------------------------------------------------------------------- /docs/_includes/layouts/get-started.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Get started" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | } 18 | ], 19 | href: "/get-started", 20 | text: "Get started" 21 | }) }} 22 | {% endif %} 23 | {% endblock %} 24 | 25 | {% set sidebar %} 26 | {{ appSideNavigation({ 27 | label: 'How we work', 28 | currentPath: page.url, 29 | sections: [ 30 | { 31 | heading: { 32 | text: 'Prototyping' 33 | }, 34 | items: collections.prototyping | sort(attribute="data.order") 35 | }, 36 | { 37 | heading: { 38 | text: 'Production' 39 | }, 40 | items: collections.production | sort(attribute="data.order") 41 | } 42 | ] 43 | }) }} 44 | {% endset %} 45 | 46 | {% block content %} 47 | {% if tags and "prototyping" in tags %} 48 | Prototyping 49 | {% elif tags and "production" in tags %} 50 | Production 51 | {% endif %} 52 |

    53 | {{ title }} 54 |

    55 | {{ content | safe }} 56 | {% endblock %} 57 | -------------------------------------------------------------------------------- /docs/examples/cards/card-group.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link 4 | figmaLink: 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhscardgroup--docs 6 | arguments: card-group 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 11 | 12 | {{ nhsappCardGroup({ 13 | cards: [ 14 | { 15 | title: 'Orthopaedic appointment', 16 | href: '#', 17 | titleClasses: 'nhsuk-u-font-size-22', 18 | linkAriaLabel: 'Orthopaedic appointment on Friday 7 June 2024 at 8:30am, at The Willows, Croydon University Hospital', 19 | descriptionHtml: ' 20 | 21 | 22 | ' 23 | }, 24 | { 25 | title: 'Orthopaedic appointment', 26 | href: '#', 27 | titleClasses: 'nhsuk-u-font-size-22', 28 | linkAriaLabel: 'Orthopaedic appointment on Monday 3 June 2024 at 9:40am, at The Willows, Croydon University Hospital', 29 | descriptionHtml: ' 30 | 31 | 32 | ' 33 | } 34 | ] 35 | }) }} -------------------------------------------------------------------------------- /docs/_includes/layouts/community.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Community" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | } 18 | ], 19 | href: "/community", 20 | text: "Community" 21 | }) }} 22 | {% endif %} 23 | {% endblock %} 24 | 25 | {% set sidebar %} 26 | {{ appSideNavigation({ 27 | label: 'Contributing and support', 28 | currentPath: page.url, 29 | sections: [ 30 | { 31 | heading: { 32 | text: 'Contributing' 33 | }, 34 | items: collections.contribution | sort(attribute="data.order") 35 | }, 36 | { 37 | heading: { 38 | text: 'Support' 39 | }, 40 | items: collections.community | sort(attribute="data.order") 41 | } 42 | ] 43 | }) }} 44 | {% endset %} 45 | 46 | {% block content %} 47 | {% if tags and "contribution" in tags %} 48 | Contributing 49 | {% elif tags and "community" in tags %} 50 | Support 51 | {% endif %} 52 |

    53 | {{ title }} 54 |

    55 |

    {{ description }}

    56 | {{ content | safe }} 57 | {% endblock %} 58 | -------------------------------------------------------------------------------- /docs/examples/cards/card-link-custom.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example.njk 3 | title: Card link icon 4 | figmaLink: 5 | vueLink: https://nhsappvuecomponentlibraryv1.nonlive.nhsapp.service.nhs.uk/?path=/docs/components-nhscardbase--docs 6 | arguments: card 7 | --- 8 | 9 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 10 | {% from 'nhsapp/components/tag/macro.njk' import nhsappTag %} 11 | 12 | {% set tag %} 13 | {{ nhsappTag({ 14 | text: 'Action needed', 15 | classes: 'nhsapp-tag--red nhsuk-u-margin-bottom-3', 16 | attributes: { 17 | 'aria-hidden': 'true' 18 | } 19 | }) }} 20 | {% endset %} 21 | 22 | {{ nhsappCard({ 23 | title: 'Orthopaedic appointment', 24 | href: '#', 25 | titleClasses: 'nhsuk-u-font-size-22', 26 | linkAriaLabel: 'Action needed: Orthopaedic appointment on Monday 3 June 2024 at 9:40am, at The Willows, Croydon University Hospital', 27 | descriptionHtml: ' 28 | 29 | 30 |

    31 | 32 | New 33 | Questionnaire attached 34 |

    35 | ', 36 | aboveContent: { html: tag } 37 | }) }} 38 | -------------------------------------------------------------------------------- /docs/_includes/layouts/component.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Components" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | } 18 | ], 19 | href: "/components", 20 | text: "Components" 21 | }) }} 22 | {% endif %} 23 | {% endblock %} 24 | 25 | {% set sidebar %} 26 | {{ appSideNavigation({ 27 | label: 'Components', 28 | currentPath: page.url, 29 | sections: [ 30 | { 31 | heading: { 32 | text: 'Components' 33 | }, 34 | items: collections.component | sort(attribute="data.title") 35 | }, 36 | { 37 | heading: { 38 | text: 'Archived' 39 | }, 40 | items: collections.archivedComponent | sort(attribute="data.title") 41 | } 42 | ] 43 | }) }} 44 | {% endset %} 45 | 46 | {% block content %} 47 | {% if tags and ("component" in tags or "archivedComponent" in tags) %} 48 | Components 49 | {% endif %} 50 |

    51 | {{ title }} 52 |

    53 |

    {{ description }}

    54 | {{ content | safe }} 55 | {% if tags and "component" in tags %} 56 | {% include "layouts/partials/feedback-section.njk" %} 57 | {% endif %} 58 | 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /docs/get-started/nhsapp-prototype/github.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/nhsapp-prototype.njk 3 | title: Store prototype code on GitHub 4 | order: 4 5 | tags: 6 | - nhsappPrototype 7 | help: no 8 | --- 9 | 10 | Store your prototype as a repository in the GitHub NHS Digital organisation account. 11 | 12 | 1. Request access to the GitHub NHS Digital organisation. Follow the [GitHub users guidance on SharePoint](https://nhs.sharepoint.com/:u:/r/sites/X26_EngineeringCOE/SitePages/GitHub-User---how-to-request-access.aspx?csf=1&web=1&e=T1oQKj) (use your `nhs.net` email to access this link). 13 | 2. Once you have access, go to the [GitHub NHS Digital organisation](https://github.com/NHSDigital) and use your `nhs.net` email to log in. 14 | 3. Select **New** to create a repository. 15 | 4. Name your prototype to avoid confusion with production services. Use the format `nhsapp-prototype-[project-name]`, such as `nhsapp-prototype-prescriptions`. 16 | 5. Select **Internal** and **Create repository**. 17 | 6. Upload your prototype to GitHub. You can follow the NHS prototype kit guidance on how to [store code online with GitHub and GitHub Desktop](https://prototype-kit.service-manual.nhs.uk/how-tos/github/index). 18 | 19 |
    20 | 21 | ## Get support 22 | 23 | For troubleshooting or support, you can ask the design Slack community at: 24 | 25 | - [#help-with-heroku](https://nhsdigitalcorporate.enterprise.slack.com/archives/C089RQPDZ9V) 26 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yaml: -------------------------------------------------------------------------------- 1 | name: 📖 Documentation 2 | description: Add new documentation, or report missing, incorrect or unclear documentation 3 | title: '[Documentation]: ' 4 | labels: 'type: documentation, awaiting triage' 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: '## Welcome!' 9 | - type: markdown 10 | attributes: 11 | value: Thanks for taking the time to fill out the details below for documentation. 12 | - type: markdown 13 | attributes: 14 | value: Please fill in as much of the template below as you're able to. If you're unsure whether the issue already exists or how to fill in the template, open an issue anyway. Our team will help you to complete the rest. 15 | - type: markdown 16 | attributes: 17 | value: Your issue might already exist. If so, add a comment to the existing issue instead of creating a new one. You can [find existing issues here](https://github.com/nhsuk/nhsapp-frontend/issues). 18 | - type: textarea 19 | id: description 20 | attributes: 21 | label: Description 22 | description: 'Tell us more about the proposal or problem.' 23 | validations: 24 | required: true 25 | - type: textarea 26 | id: example-url 27 | attributes: 28 | label: Related documentation 29 | description: 'Does this issue refer to a gap or mistake in some existing documentation? Provide a link if possible.' 30 | - type: textarea 31 | id: evidence 32 | attributes: 33 | label: Evidence (where applicable) 34 | description: 'Please provide any relevant user research or evidence to support this change.' 35 | -------------------------------------------------------------------------------- /docs/examples/sub-hub-pages/prescriptions.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Your health 5 | title: Prescriptions 6 | backlink: true 7 | figmaLink: 8 | vueLink: 9 | --- 10 | 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 12 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 13 | 14 |
    15 |
    16 | 17 |

    View and manage prescriptions

    18 |

    Check your prescriptions and choose the pharmacy they are collected or delivered from

    19 | 20 | {{ nhsappCardGroup({ 21 | stacked: true, 22 | cards: [ 23 | { 24 | title: 'Requested medicines', 25 | description: 'Check if your GP has approved the medicines you requested in the app', 26 | href: '/pages/your-health/requested-medicines' 27 | }, 28 | { 29 | title: 'Check if your prescriptions are ready', 30 | description: 'View prescriptions being prepared by the pharmacy', 31 | href: '/pages/your-health/your-approved-prescriptions' 32 | }, 33 | { 34 | title: 'Choose a pharmacy', 35 | description: 'Choose or change a pharmacy for your prescriptions to be collected or delivered from', 36 | href: '#' 37 | }, 38 | { 39 | title: 'Hospital and other medicines', 40 | description: 'View your current and past medicines', 41 | href: '#' 42 | } 43 | ] 44 | })}} 45 | 46 |
    47 |
    -------------------------------------------------------------------------------- /docs/get-started/nhsapp-prototype/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/get-started.njk 3 | title: NHS App prototype 4 | order: 1 5 | tags: 6 | - prototyping 7 | help: no 8 | --- 9 | 10 | The NHS App lets you create interactive prototypes that look like real NHS App pages. It builds on the NHS prototype kit with added custom layouts and components tailored to the NHS App. 11 | 12 | - [Setup and download](/get-started/nhsapp-prototype/setup/) 13 | - [Using the NHS App prototype](/get-started/nhsapp-prototype/how-to-use/) 14 | - [Store prototype code on GitHub](/get-started/nhsapp-prototype/github/) 15 | - [Host prototypes on Heroku](/get-started/nhsapp-prototype/heroku/) 16 | 17 | You can also [read a blog about why prototyping in code is important](https://digital.nhs.uk/blog/design-matters/2025/why-we-are-reinvesting-in-the-nhs-prototype-kit). 18 | 19 |
    20 | 21 | ## Help improve the NHS App prototype 22 | 23 | We welcome feedback and suggestions to help improve the NHS App prototype. 24 | 25 | If you have any ideas, feature requests, or issues to report, please [submit an issue on GitHub](https://github.com/nhsuk/nhsapp-prototype/issues). 26 | 27 |
    28 | 29 | ## Get support 30 | 31 | For troubleshooting or support, you can ask the design Slack community at: 32 | 33 | - [#prototype-kit](https://nhsdigitalcorporate.enterprise.slack.com/archives/C042J3MTJG2) 34 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 35 | -------------------------------------------------------------------------------- /docs/get-started/nhsapp-prototype/setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/nhsapp-prototype.njk 3 | title: Setup and download 4 | order: 1 5 | tags: 6 | - nhsappPrototype 7 | help: no 8 | --- 9 | 10 | To use the NHS App prototype, you'll need a few tools installed. If you already have them, you can skip ahead and download a copy. 11 | 12 | ## Install required tools 13 | 14 | You need: 15 | 16 | - [Node.js](https://nodejs.org/en/download) version 20 or higher 17 | - an HTML text editor, such as [Visual Studio Code (VS Code)](https://code.visualstudio.com/download) 18 | 19 | If you're not sure whether the tools are installed – or how to install them – follow the [NHS prototype kit setup guide](https://prototype-kit.service-manual.nhs.uk/install/simple) to get everything you need. 20 | 21 | ## Download the NHS App prototype 22 | 23 | The simplest way to get a copy is to [download it as a zip](https://github.com/nhsuk/nhsapp-prototype/archive/refs/heads/main.zip). 24 | 25 | You can also clone or download a copy from [GitHub](https://github.com/nhsuk/nhsapp-prototype). 26 | 27 |
    28 |

    You can download a new copy for each project and store your code on GitHub.

    29 |
    30 | 31 |
    32 | 33 | ## Get support 34 | 35 | For troubleshooting or support, you can ask the design Slack community at: 36 | 37 | - [#prototype-kit](https://nhsdigitalcorporate.enterprise.slack.com/archives/C042J3MTJG2) 38 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 39 | -------------------------------------------------------------------------------- /docs/examples/error-pages/template.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | title: Error page - Template 5 | hub: Your health 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'button/macro.njk' import button %} 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 12 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 13 | 14 |
    15 |
    16 | 17 |

    Page heading

    18 | 19 |

    Page description to help users understand the problem.

    20 | 21 |

    If the problem continues

    22 | 23 |

    Make a note of the error code 3ezxja and then contact the NHS App team.

    24 | 25 |

    For urgent medical advice, use 111 online or call 111.

    26 | 27 | {{ button({ 28 | text: 'CTA button', 29 | classes: 'nhsuk-button--secondary nhsapp-button nhsuk-u-margin-top-3' 30 | }) }} 31 | 32 |

    Other options in the NHS App

    33 | 34 | {{ nhsappCardGroup({ 35 | stacked: true, 36 | classes: 'nhsapp-cards--secondary', 37 | cards: [ 38 | { 39 | title: 'Option one', 40 | href: '#' 41 | }, 42 | { 43 | title: 'Option two', 44 | href: '#' 45 | } 46 | ] 47 | }) }} 48 | 49 |
    50 | Go to [app area] 51 |
    52 | 53 |
    54 |
    -------------------------------------------------------------------------------- /docs/examples/hub-pages/example.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Your health 5 | title: Your health 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 12 | 13 |
    14 |
    15 | 16 |

    Your health

    17 |

    View your personal records and choices

    18 | 19 | {{ nhsappCardGroup({ 20 | stacked: true, 21 | cards: [ 22 | { 23 | title: 'GP health record', 24 | href: '#' 25 | }, 26 | { 27 | title: 'View and manage prescriptions', 28 | href: '/pages/your-health/prescriptions-p9' 29 | }, 30 | { 31 | title: 'Upcoming and past appointments', 32 | href: '/pages/your-health/upcoming-and-past-appointments-p9' 33 | }, 34 | { 35 | title: 'Test results and imaging', 36 | href: '#' 37 | }, 38 | { 39 | title: 'COVID-19 vaccine record', 40 | href: '#' 41 | }, 42 | { 43 | title: 'NHS COVID Pass', 44 | href: '#' 45 | }, 46 | { 47 | title: 'Your health choices', 48 | href: '/pages/your-health/your-health-choices-p9' 49 | }, 50 | { 51 | title: 'Care plans', 52 | href: '/pages/your-health/care-plans-p9' 53 | } 54 | ] 55 | })}} 56 | 57 |
    58 |
    -------------------------------------------------------------------------------- /docs/examples/hub-pages/your-health.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Your health 5 | title: Your health 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 12 | 13 |
    14 |
    15 | 16 |

    Your health

    17 |

    View your personal records and choices

    18 | 19 | {{ nhsappCardGroup({ 20 | stacked: true, 21 | cards: [ 22 | { 23 | title: 'GP health record', 24 | href: '#' 25 | }, 26 | { 27 | title: 'View and manage prescriptions', 28 | href: '/pages/your-health/prescriptions-p9' 29 | }, 30 | { 31 | title: 'Upcoming and past appointments', 32 | href: '/pages/your-health/upcoming-and-past-appointments-p9' 33 | }, 34 | { 35 | title: 'Test results and imaging', 36 | href: '#' 37 | }, 38 | { 39 | title: 'COVID-19 vaccine record', 40 | href: '#' 41 | }, 42 | { 43 | title: 'NHS COVID Pass', 44 | href: '#' 45 | }, 46 | { 47 | title: 'Your health choices', 48 | href: '/pages/your-health/your-health-choices-p9' 49 | }, 50 | { 51 | title: 'Care plans', 52 | href: '/pages/your-health/care-plans-p9' 53 | } 54 | ] 55 | })}} 56 | 57 |
    58 |
    -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NHS App Frontend 2 | 3 | NHS App Frontend is a CSS library built on top of [nhsuk-frontend](https://github.com/nhsuk/nhsuk-frontend) providing styles for the NHS App. 4 | 5 | See live examples of NHS App Frontend components, and guidance on when to use them in your service, in the [NHS App Frontend components documentation](https://design-system.nhsapp.service.nhs.uk/components/). 6 | 7 | ## Contact the team 8 | 9 | NHS App Frontend is mainatined by staff at NHS England. If you have a question, you can use [GitHub issues](https://github.com/nhsuk/nhsapp-frontend/issues) or one of these Slack channels: 10 | 11 | - [#general](https://nhs-service-manual.slack.com/archives/CDJ29AQCD) on NHS service manual Slack 12 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) on NHS England Slack 13 | 14 | ## Building on the NHS digital service manual 15 | 16 | The NHS App uses the [NHS design system](https://service-manual.nhs.uk/design-system), however it also uses NHS App-specific design components and patterns that need documenting with guidance. 17 | 18 | ## Documenting NHS App design components and patterns 19 | 20 | We use a [GitHub project board](https://github.com/orgs/nhsuk/projects/8/views/1) to track design components and patterns used across the NHS app, along with any feedback, questions or user insights. All this information links back to the [NHS digital service manual community backlog](https://github.com/nhsuk/nhsuk-service-manual-community-backlog/projects/1) so anyone working on an NHS project can look and learn from it. 21 | 22 | --- 23 | 24 | ### **[View and discuss NHS App design components and patterns](https://github.com/orgs/nhsuk/projects/8/views/1)** 25 | 26 | --- 27 | -------------------------------------------------------------------------------- /docs/_includes/layouts/pattern.njk: -------------------------------------------------------------------------------- 1 | {% extends "./sidebar.njk" %} 2 | 3 | {%- from "./partials/side-navigation.njk" import appSideNavigation %} 4 | 5 | {% block beforeContent %} 6 | {% if title === "Patterns" %} 7 | {{ breadcrumb({ 8 | href: "/", 9 | text: "Home" 10 | }) }} 11 | {% else %} 12 | {{ breadcrumb({ 13 | items: [ 14 | { 15 | href: "/", 16 | text: "Home" 17 | } 18 | ], 19 | href: "/patterns", 20 | text: "Patterns" 21 | }) }} 22 | {% endif %} 23 | {% endblock %} 24 | 25 | {% set sidebar %} 26 | {{ appSideNavigation({ 27 | label: 'Patterns', 28 | currentPath: page.url, 29 | sections: [ 30 | { 31 | heading: { 32 | text: 'Pages' 33 | }, 34 | items: collections.page | sort(attribute="data.title") 35 | }, 36 | { 37 | heading: { 38 | text: 'Help users to' 39 | }, 40 | items: collections.helpUsers | sort(attribute="data.title") 41 | } 42 | ] 43 | }) }} 44 | {% endset %} 45 | 46 | {% block content %} 47 | {% if tags and "page" in tags %} 48 | Pages 49 | {% elif tags and "helpUsers" in tags %} 50 | Help users to 51 | {% endif %} 52 |

    53 | {{ title }} 54 |

    55 | {% if pageNotice %} 56 | {% include "layouts/partials/" + pageNotice + ".njk" %} 57 | {% endif %} 58 |

    {{ description }}

    59 | {{ content | safe }} 60 | {% if tags and ("page" in tags or "helpUsers" in tags) %} 61 | {% include "layouts/partials/feedback-section.njk" %} 62 | {% endif %} 63 | {% endblock %} 64 | -------------------------------------------------------------------------------- /docs/get-started/installing-with-npm.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/get-started.njk 3 | title: Installing NHS App frontend with npm 4 | --- 5 | 6 | ## Requirements 7 | 8 | To use NHS App frontend with node package manager (npm) you must: 9 | 10 | 1. Install the long-term support (LTS) version of [Node.js](https://nodejs.org/en/), which includes npm. 11 | 12 | 2. Create a [package.json file](https://docs.npmjs.com/files/package.json) if you don’t already have one. You can create a default `package.json` file by running `npm init` from the root of your application. 13 | 14 | ## Installation 15 | 16 | To install, run: 17 | 18 | ```sh 19 | npm install --save nhsapp-frontend 20 | ``` 21 | 22 | If you want to use the NHS App frontend Nunjucks macros, install Nunjucks - the minimum version required is 3.0.0. 23 | 24 | ```sh 25 | npm install nunjucks --save 26 | ``` 27 | 28 | After you have installed NHS App frontend the `nhsapp-frontend` package will appear in your `node_modules` folder. 29 | 30 | ## Importing styles 31 | 32 | You need to import the NHS App frontend styles into the main Sass file in your project. You should place the below code before your own Sass rules (or Sass imports) if you want to override NHS App frontend with your own styles. 33 | 34 | 1. To import all components, add the below to your Sass file: 35 | 36 | ```CSS 37 | @import "node_modules/nhsapp-frontend/all"; 38 | ``` 39 | 40 | 2. To import an individual component (for example a button), add the below to your Sass file: 41 | 42 | ```CSS 43 | @import "node_modules/nhsapp-frontend/components/button/button"; 44 | ``` 45 | 46 | ## Importing assets 47 | 48 | The NHS App Frontend ships with all SVG icons. They can be found in `node_modules/nhsapp-frontend/assets/icons`. 49 | -------------------------------------------------------------------------------- /src/components/timeline/timeline.njk: -------------------------------------------------------------------------------- 1 | {% from "nhsuk/macros/attributes.njk" import nhsukAttributes %} 2 | 3 | {% macro _timelineItem(params, item) %} 4 | {% set headingLevel = params.headingLevel if params.headingLevel else 3 %} 5 | {% set headingBold = 'nhsuk-u-font-weight-bold' if item.active else '' %} 6 | {% set isPastItem = 'nhsapp-timeline__item--past' if item.isPastItem else '' %} 7 | 8 |
  • 9 | {% if item.active or item.isPastItem %} 10 | 13 | {% else %} 14 | 17 | {% endif %} 18 |
    19 | {{ item.headingText }} 20 | {% if item.html %} 21 | {{ item.html | safe | trim }} 22 | {% elif item.text %} 23 |

    {{ item.text }}

    24 | {% endif %} 25 |
    26 |
  • 27 | {% endmacro %} 28 | 29 |
      30 | {% for item in params.items %} 31 | {% if item %}{{ _timelineItem(params, item) }}{% endif %} 32 | {% endfor %} 33 |
    -------------------------------------------------------------------------------- /docs/components/tag.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Tag 4 | description: Use tags to show a status. Tags only display information and are not interactive. 5 | backlogID: 11 6 | tags: 7 | - component 8 | --- 9 | 10 | {% example "tags/tag.njk" %} 11 | 12 | ## When to use 13 | 14 | Use tags to help users: 15 | 16 | - understand the status of an activity or a process 17 | - keep track of progress 18 | - understand when they need to take an action 19 | 20 | For example, tags can help users to: 21 | 22 | - track prescription requests 23 | - understand when they need to take an action regarding a hospital referral 24 | 25 | ## When not to use 26 | 27 | Too many tags, and lots of variation in tag colours, may clutter a page and overwhelm users. Tags can also affect the visual hierarchy of a page. This means tags should be used sparingly. 28 | 29 | ## How to use 30 | 31 | Tags can be placed within a card or outside of one. Inside a card, tags should always be left-aligned. Outside a card, tags can be aligned to the left or the right. 32 | 33 | Tag text should: 34 | 35 | - be in sentence case 36 | - describe status in as few words as possible 37 | 38 | ## How not to use 39 | 40 | Do not use tags: 41 | 42 | - as a header or grouping-class for elements or information 43 | - as a selectable element 44 | 45 | Tag text should not: 46 | 47 | - be in bold 48 | - start with a verb – users may think they can select the tag 49 | 50 | ## Accessibility 51 | 52 | Tag colours meet [WCAG 2.2 Success Criterion 1.4.3 Contrast (Minimum)](https://www.w3.org/TR/WCAG22/#contrast-minimum) AAA. 53 | 54 | ## Research 55 | 56 | In our research, we found that red tags could cause some participants to feel concerned. Red was associated with something having gone wrong. 57 | -------------------------------------------------------------------------------- /docs/components/top-navigation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Top navigation 4 | description: Use the top navigation to help users access ‘Help’ and ‘Account and settings’ links from anywhere in the app. 5 | backlogID: 17 6 | tags: 7 | - component 8 | --- 9 | 10 | ![The top navigation menu. There are two right-aligned icons: one is a question mark and the other is shaped like a person.](/assets/images/top-nav.png) 11 | 12 | ## When to use 13 | 14 | The top navigation is visible at the top almost every screen within the main app journey. The exception is when external pages open in a web browser overlay. 15 | 16 | The top navigation remains fixed in position as users scroll. 17 | 18 | ## When not to use 19 | 20 | On the web browser version of the NHS App, we use an [NHS.UK header](https://service-manual.nhs.uk/design-system/components/header) with text links, instead of the top navigation with icons. 21 | 22 | ## How to use 23 | 24 | The top navigation includes a link to the NHS App help and support pages hosted on NHS.UK. This is a contextual link that takes users to a page relevant to their location in the app. For example, if a user is on a prescription screen, the help link will open a help page about prescriptions. 25 | 26 | The top also includes an ’Account and settings’ link. This opens the respective hub page. 27 | 28 | ![Details of the top navigation menu. The question mark icon links to Help and Support. The person icon links to Account.](/assets/images/top-nav-2.png) 29 | 30 | ## Accessibility 31 | 32 | The top navigation icons do not have text labels. They have aria labels which are announced by screen readers. 33 | 34 | ## Research 35 | 36 | In our research, people recognised the meaning of the icons without the need for text labels. 37 | -------------------------------------------------------------------------------- /src/components/badge/small/macro-options.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | Name | Type | Required | Description | 4 | | ---------------- | ------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | 5 | | text | string | conditional | If `html` is set, this is not required. Text to use within the badge component. If `html` is provided, the `text` argument will be ignored. | 6 | | html | string | conditional | If `text` is set, this is not required. HTML to use within the badge component. If `html` is provided, the `text` argument will be ignored. | 7 | | label | string | yes | Visually hidden accessible text before the `text` (for example `New`). | 8 | | positionAbsolute | boolean | no | When true adds the `nhsapp-badge-small--absolute` class so the badge can be absolutely positioned within a relatively positioned parent container. | 9 | | id | string | no | ID attribute for the badge. | 10 | | classes | string | no | Classes for the badge. | 11 | | attributes | object | no | HTML attributes for the badge (for example `data-*` or `aria-*`). | 12 | -------------------------------------------------------------------------------- /docs/assets/css/_colour.scss: -------------------------------------------------------------------------------- 1 | @use "sass:math"; 2 | 3 | //// 4 | /// Colour swatch 5 | /// 6 | /// Custom table for the colour palette 7 | //// 8 | 9 | .app-colour-list { 10 | margin-top: 0; 11 | 12 | th, 13 | td { 14 | border: 0; 15 | } 16 | } 17 | 18 | .app-colour-list__swatch { 19 | background-color: nhsuk-colour("grey-5"); 20 | border: 1px solid transparent; 21 | border-radius: 50%; 22 | display: inline-block; 23 | height: nhsuk-spacing(6); 24 | margin-right: 0; 25 | vertical-align: middle; 26 | width: nhsuk-spacing(6); 27 | 28 | position: absolute; 29 | left: 0; 30 | top: math.div(nhsuk-spacing(1), 2); 31 | 32 | @include nhsuk-media-query($until: tablet) { 33 | height: nhsuk-spacing(4); 34 | width: nhsuk-spacing(4); 35 | top: nhsuk-spacing(1); 36 | } 37 | } 38 | 39 | .app-colour-list__column { 40 | padding-left: 0; 41 | padding-top: nhsuk-spacing(2); 42 | vertical-align: top; 43 | 44 | @include nhsuk-media-query($until: tablet) { 45 | display: block; 46 | padding-left: nhsuk-spacing(5); 47 | position: relative; 48 | } 49 | 50 | code:not([class*="language-"]) { 51 | background: transparent; 52 | color: $nhsuk-text-colour; 53 | } 54 | } 55 | 56 | .app-colour-list__column--name { 57 | font-weight: normal; 58 | position: relative; 59 | padding-left: nhsuk-spacing(8); 60 | 61 | @include nhsuk-media-query($until: tablet) { 62 | padding-left: nhsuk-spacing(5); 63 | padding-bottom: nhsuk-spacing(1); 64 | padding-top: nhsuk-spacing(1); 65 | } 66 | } 67 | 68 | .app-colour-list__column--colour { 69 | @include nhsuk-media-query($until: tablet) { 70 | padding-top: 0; 71 | padding-bottom: nhsuk-spacing(1); 72 | } 73 | } 74 | 75 | .app-colour-list__swatch--border { 76 | border: 1px solid $nhsuk-border-colour; 77 | } 78 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nhsapp-frontend", 3 | "version": "5.0.3", 4 | "description": "A CSS library built on top of nhsuk-frontend providing styles for the NHS App.", 5 | "main": "index.js", 6 | "type": "module", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "prepack": "gulp bundle", 12 | "release": "gulp release", 13 | "lint": "prettier --check .", 14 | "start": "concurrently npm:docs:serve npm:css:watch", 15 | "docs:serve": "npm run css:build && npx @11ty/eleventy --serve", 16 | "docs:build": "npm run css:build && npx @11ty/eleventy", 17 | "css:watch": "gulp", 18 | "css:build": "gulp compileCSS", 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/nhsuk/nhsapp-frontend.git" 24 | }, 25 | "author": "", 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/nhsuk/nhsapp-frontend/issues" 29 | }, 30 | "homepage": "https://github.com/nhsuk/nhsapp-frontend#readme", 31 | "devDependencies": { 32 | "@11ty/eleventy": "3.0.0-alpha.6", 33 | "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", 34 | "concurrently": "^8.2.2", 35 | "fs-extra": "^11.2.0", 36 | "gulp": "^5.0.0", 37 | "gulp-clean": "^0.4.0", 38 | "gulp-clean-css": "^4.3.0", 39 | "gulp-cli": "^3.0.0", 40 | "gulp-connect": "^5.7.0", 41 | "gulp-nunjucks": "^6.0.0", 42 | "gulp-rename": "^2.0.0", 43 | "gulp-sass": "^5.1.0", 44 | "gulp-uglify": "^3.0.2", 45 | "gulp-zip": "^6.0.0", 46 | "markdown-it-anchor": "^9.0.1", 47 | "nhsuk-frontend": "^10.0.0", 48 | "nunjucks": "^3.2.4", 49 | "plugin-error": "^1.0.1", 50 | "prettier": "^3.2.5", 51 | "sass": "^1.74.1" 52 | }, 53 | "peerDependencies": { 54 | "nhsuk-frontend": "^10.0.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/get-started/nhsapp-prototype/heroku.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/nhsapp-prototype.njk 3 | title: Publish prototypes online with Heroku 4 | order: 5 5 | tags: 6 | - nhsappPrototype 7 | help: no 8 | --- 9 | 10 | You can host your NHS App prototype using Heroku and connect it directly to your GitHub repository. 11 | 12 | 1. Go to [heroku.com](https://www.heroku.com/) and sign up for a free account using your `nhs.net` email. 13 | 2. See the [Access Heroku guidance (on SharePoint)](https://nhs.sharepoint.com/:u:/r/sites/X26_URPG/SitePages/tools/Heroku-cloud-platform.aspx?csf=1&web=1&e=geWbJC) to join the **nhs-heroku**. 14 | 3. Log in to [dashboard.heroku.com](https://dashboard.heroku.com). 15 | 4. Select **nhs-heroku > nhs-app > New > Create new app**, choose a name `nhsapp-prototype-[project-name]`, and select region **Europe**. 16 | 5. In the **Deploy** tab of your app, choose **GitHub** as your deployment method. You'll be prompted to log in to GitHub: make sure you use your `hscic.gov.uk` email address to do this. 17 | 6. Search and connect to your GitHub repo. 18 | 7. Choose a branch (usually `main`). 19 | 8. Enable **Automatic deploys** to publish changes every time you push to GitHub. 20 | 9. Select **Deploy Branch**. 21 | 10. In **Settings > Config Vars > Reveal Config Vars** you need to set a password - [see NHS prototype kit guidance for setting a password](https://prototype-kit.service-manual.nhs.uk/how-tos/publish-your-prototype-online). 22 | 11. Select **Open app** to view your prototype. 23 | 24 |
    25 | 26 | ## Get support 27 | 28 | For troubleshooting or support, you can ask the design Slack community at: 29 | 30 | - [#help-with-heroku](https://nhsdigitalcorporate.enterprise.slack.com/archives/C089RQPDZ9V) 31 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 32 | -------------------------------------------------------------------------------- /docs/patterns/homepage.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/pattern.njk 3 | title: Homepage 4 | description: The homepage shows the user their name and NHS number, and gives links to the most popular parts of the NHS App. We work this out using Adobe Analytics and user feedback. The homepage is also used to promote important health campaigns. 5 | pageNotice: notice-homepage 6 | backlogID: 66 7 | --- 8 | 9 | {% example "homepage/homepage-native.njk" %} 10 | 11 | ## The structure of the homepage 12 | 13 | ### Main heading 14 | 15 | This main heading includes the name of the user and a greeting that changes depending on the time of day. The name is sourced from the [personal demographics service (PDS)](https://digital.nhs.uk/services/personal-demographics-service) and may display in sentence case or block capitals depending on the data. 16 | 17 | Below the name, we display the NHS number of the user. In research, participants regularly tell us they find having their NHS number here to be useful. 18 | 19 | ### Card links 20 | 21 | [Card links](/components/card-links/) on the page lead either directly to the start of a journey, or to a hub page. 22 | 23 | ### Campaign card 24 | 25 | The campaign card promotes public health messaging agreed on by the senior leadership team of the NHS App that: 26 | 27 | - is relevant to most NHS App users 28 | - has an onward digital journey that meets our [usability and accessibility standards](https://digital.nhs.uk/services/nhs-app/how-to-integrate-with-the-nhs-app/standards-for-nhs-app-integration) 29 | 30 | ## Proposing changes to the homepage 31 | 32 | We’re careful to limit the number of links on the homepage. We need to make sure users can quickly scan through the page and access popular features. 33 | 34 | The Navigation and Onboarding team maintains and updates the homepage. We regularly review and test the selection of links that are included. If you'd like to suggest changes to the homepage, please contact us on Slack. 35 | -------------------------------------------------------------------------------- /docs/examples/hub-pages/services.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/example-full-page-mobile.njk 3 | mobile: true 4 | hub: Services 5 | title: Services 6 | figmaLink: 7 | vueLink: 8 | --- 9 | 10 | {% from 'nhsapp/components/card/macro.njk' import nhsappCardGroup %} 11 | {% from 'nhsapp/components/card/macro.njk' import nhsappCard %} 12 | 13 |
    14 |
    15 | 16 |

    Services

    17 |

    Get care and support to help you stay well

    18 | 19 | {{ nhsappCardGroup({ 20 | stacked: true, 21 | heading: 'Your GP services', 22 | cards: [ 23 | { 24 | title: 'Request medicines', 25 | href: '#' 26 | }, 27 | { 28 | title: 'Contact your GP surgery for a document or update', 29 | href: '#' 30 | }, 31 | { 32 | title: 'Check for available GP appointments', 33 | href: '#' 34 | } 35 | ] 36 | }) }} 37 | 38 | {{ nhsappCardGroup({ 39 | stacked: true, 40 | heading: 'Other NHS services', 41 | cards: [ 42 | { 43 | title: 'Check if you need urgent medical help using 111 online', 44 | href: '#' 45 | }, 46 | { 47 | title: 'Find NHS services near you', 48 | href: '#' 49 | } 50 | ] 51 | }) }} 52 | 53 | {{ nhsappCardGroup({ 54 | stacked: true, 55 | heading: 'Find health information', 56 | cards: [ 57 | { 58 | title: 'Browse NHS health information', 59 | href: '#' 60 | }, 61 | { 62 | title: 'Browse NHS medicines information', 63 | href: '#' 64 | }, 65 | { 66 | title: 'Find COVID-19 guidance', 67 | href: '#' 68 | } 69 | ] 70 | })}} 71 | 72 |
    73 |
    -------------------------------------------------------------------------------- /src/components/timeline/macro-options.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | Name | Type | Required | Description | 4 | | ------------------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------- | 5 | | headingLevel | number | no | Heading level for each item heading. Defaults to `3` (`

    `). Must be between 2 and 6. | 6 | | items | array | yes | Array of timeline item objects. Falsy entries are ignored. | 7 | | items[].headingText | string | yes | Text for the item heading. | 8 | | items[].html | string | conditional | If `text` is set, this is not required. Raw HTML description inserted directly. If set, `text` is ignored. | 9 | | items[].text | string | conditional | If `html` is set, this is not required. Plain text description wrapped in a paragraph element. | 10 | | items[].active | boolean | no | Renders a large blue dot and bold heading styling for the current (active) item. | 11 | | items[].isPastItem | boolean | no | Marks the item as past: large blue dot and adds modifier class `nhsapp-timeline__item--past`. | 12 | | id | string | no | The ID of the timeline. | 13 | | classes | string | no | Classes to add to the timeline. | 14 | | attributes | object | no | HTML attributes for the timeline (e.g. `data-*`, `aria-*`). | 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yaml: -------------------------------------------------------------------------------- 1 | name: 🐛 Bug report 2 | description: Something not working as expected? This is the place to report your issue. 3 | title: '[Bug]: ' 4 | labels: 'type: bug, awaiting triage' 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: '## Welcome!' 9 | - type: markdown 10 | attributes: 11 | value: Thanks for taking the time to fill out this bug report. 12 | - type: markdown 13 | attributes: 14 | value: Please fill in as much of the template below as you're able to. If you're unsure whether the issue already exists or how to fill in the template, open an issue anyway. Our team will help you to complete the rest. 15 | - type: markdown 16 | attributes: 17 | value: Your issue might already exist. If so, add a comment to the existing issue instead of creating a new one. You can [find existing issues here](https://github.com/nhsuk/nhsapp-frontend/issues). 18 | - type: dropdown 19 | id: browser 20 | attributes: 21 | label: Browser 22 | description: Which browser(s) are you experiencing the issue? 23 | multiple: true 24 | options: 25 | - Chrome 26 | - Safari 27 | - Firefox 28 | - Edge 29 | - type: input 30 | id: version 31 | attributes: 32 | label: NHS App Frontend version 33 | description: 'Which version(s) of the NHS App Frontend are you using? This can be found in your package.json file.' 34 | placeholder: e.g. v1.2.0 35 | - type: textarea 36 | id: description 37 | attributes: 38 | label: Description 39 | description: "Tell us more about the problem that you're running into" 40 | placeholder: What did you see? What did you expect to see? 41 | validations: 42 | required: true 43 | - type: textarea 44 | id: reproduce 45 | attributes: 46 | label: Steps to reproduce 47 | description: 'How do we reproduce the error you described using the 48 | reproduction/example link above?' 49 | -------------------------------------------------------------------------------- /docs/components/bottom-navigation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/component.njk 3 | title: Bottom navigation 4 | description: The bottom navigation helps users return to the homepage or move to a hub page. 5 | backlogID: 53 6 | tags: 7 | - component 8 | --- 9 | 10 | ![The bottom navigation menu. It contains four icons with text labels: Home, Services, Your health and Messages.](/assets/images/bottom-nav.png) 11 | 12 | ## When to use 13 | 14 | The bottom navigation is visible at the bottom of most pages in the NHS App. The exception is when external pages open in a web browser overlay. 15 | 16 | The top navigation remains fixed in position as users scroll. 17 | 18 | ## When not to use 19 | 20 | The bottom navigation is not part of the web browser version of the NHS App. The same links are contained within an NHS.UK header instead. The bottom navigation is also not visible when external content is opened in a browser overlay within the NHS App, for example if a user navigates to the help and support pages hosted on the NHS website. 21 | 22 | ## How to use 23 | 24 | Each hub is represented by a text label and an icon. The text labels match the main heading on the respective hub page. 25 | 26 | ![Details of the bottom navigation menu. Icons become highlighted when selected. An unread indicator can be placed over icons.](/assets/images/bottom-nav-2.png) 27 | 28 | ## Accessibility 29 | 30 | Bear in mind that the bottom navigation can be easier for users to reach than the top navigation. This lends itself to links that users may need more frequently. 31 | 32 | ## Research 33 | 34 | The ‘Home’ link was previously placed on the top navigation of the NHS App. In usability testing, participants found it easier to use the link when it was placed on the bottom navigation. They also noticed that this placement was more consistent with other popular apps. 35 | 36 | We also tested recognition of the hub page icons. The icons were well recognised. The use of text labels was needed to help users differentiate the ‘Services’ and ‘Your health’ icons. 37 | -------------------------------------------------------------------------------- /docs/assets/css/_tabs.scss: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | #TABS 3 | ========================================================================== */ 4 | 5 | .app-tabs { 6 | @include nhsuk-responsive-margin(5, "bottom"); 7 | 8 | background-color: nhsuk-colour("white"); 9 | } 10 | 11 | .app-tabs__list { 12 | border: 1px solid $nhsuk-border-colour; 13 | border-top: 0; 14 | list-style: none; 15 | margin: 0; 16 | padding: 0; 17 | 18 | display: flex; 19 | } 20 | 21 | .app-tabs__list-item { 22 | border-right: 1px solid $nhsuk-border-colour; 23 | margin: 0; 24 | 25 | z-index: 2; 26 | } 27 | 28 | .app-tabs__tab { 29 | @include nhsuk-font($size: 19); 30 | color: nhsuk-colour("blue"); 31 | display: block; 32 | padding: 16px; 33 | position: relative; 34 | text-decoration: underline; 35 | 36 | @include nhsuk-media-query($from: desktop) { 37 | padding: 16px 20px; 38 | } 39 | 40 | &[aria-selected="true"] { 41 | background-color: nhsuk-colour("white"); 42 | color: nhsuk-colour("black"); 43 | font-weight: bold; 44 | margin-bottom: -1px; 45 | padding-bottom: 21px; 46 | text-decoration: none; 47 | 48 | &:focus { 49 | background-color: $nhsuk-focus-colour; 50 | box-shadow: 51 | 0 -2px $nhsuk-focus-colour, 52 | inset 0 -4px $nhsuk-focus-text-colour; 53 | } 54 | } 55 | } 56 | 57 | .app-tabs__panel { 58 | @include nhsuk-font($size: 16); 59 | background-color: nhsuk-colour("white"); 60 | border: 1px solid $nhsuk-border-colour; 61 | border-top: 0; 62 | position: relative; 63 | 64 | &--hidden { 65 | display: none; 66 | } 67 | 68 | *:last-of-type { 69 | margin-bottom: 0; // Remove margin bottom from any last element 70 | } 71 | 72 | p { 73 | max-width: 100% !important; 74 | padding: nhsuk-spacing(2); 75 | } 76 | 77 | .nhsuk-details__text p { 78 | padding: 0; 79 | } 80 | } 81 | 82 | .app-tabs + h2, 83 | .app-tabs + h3 { 84 | @include nhsuk-responsive-padding(4, "top"); 85 | } 86 | -------------------------------------------------------------------------------- /docs/get-started/nhsapp-prototype/how-to-use.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/nhsapp-prototype.njk 3 | title: Using the NHS App prototype 4 | order: 3 5 | tags: 6 | - nhsappPrototype 7 | help: no 8 | --- 9 | 10 | To use the NHS App prototype, you’ll need some basic knowledge of HTML – like understanding tags and attributes, and how to copy and paste code. 11 | 12 | ## Learning HTML and CSS 13 | 14 | If you're new to HTML and CSS, you can get started with online tutorials from: 15 | 16 | - [MDN Web Docs](https://developer.mozilla.org/) 17 | - [Codecademy](https://www.codecademy.com/) 18 | - [W3Schools online web tutorials](https://www.w3schools.com/html/default.asp) 19 | - or other online tutorials 20 | 21 | ## NHS prototype kit guides 22 | 23 | The [NHS prototype kit guides](https://prototype-kit.service-manual.nhs.uk/how-tos) provide step-by-step instructions – from creating a simple page to building complex user journeys. 24 | 25 | ### Build a basic prototype tutorial 26 | 27 | We recommend following the [build a basic prototype tutorial](https://prototype-kit.service-manual.nhs.uk/how-tos/build-basic-prototype/index) to familiarise yourself with prototyping. 28 | 29 | ## NHS App prototype templates and components 30 | 31 | The NHS App prototype includes pre-installed code specific to the app, such as: 32 | 33 | - [page templates and layouts](https://nhs-app-redesign-prototype-96ab88b99fdb.herokuapp.com/pages/) 34 | - [components](https://nhs-app-redesign-prototype-96ab88b99fdb.herokuapp.com/components/) 35 | 36 | These are available within your copy of the prototype and can be edited or extended to meet the needs of your project. 37 | 38 |
    39 | 40 | ## Get support 41 | 42 | For troubleshooting or support, you can ask the design Slack community at: 43 | 44 | - [#prototype-kit](https://nhsdigitalcorporate.enterprise.slack.com/archives/C042J3MTJG2) 45 | - [#nhsapp-design-system](https://nhsdigitalcorporate.enterprise.slack.com/archives/C06GY1LRP19) 46 | -------------------------------------------------------------------------------- /src/components/card/card-group.njk: -------------------------------------------------------------------------------- 1 | {% from "nhsuk/macros/attributes.njk" import nhsukAttributes %} 2 | {% set stackedClass = 'nhsapp-cards--stacked' if params.stacked else '' %} 3 | {% set headingLevel = params.headingLevel if params.headingLevel else 2 %} 4 | 5 | {% from "./macro.njk" import nhsappCard %} 6 | 7 | {%- if params.headingHtml -%} 8 | {{ params.headingHtml | safe }} 9 | {% elif params.heading %} 10 | 11 | {{ params.heading }} 12 | 13 | {% endif %} 14 | 15 | {% if params.description %} 16 |

    17 | {{ params.description }} 18 |

    19 | {% elif params.descriptionHtml %} 20 | {{ params.descriptionHtml | safe }} 21 | {% endif %} 22 | 23 | {# Control whether it renders as a list of
  • inside a