Skip to main content
Preview This is a design system preview environment for main branch

Internal review app NHS.UK frontend

Use design system guidance and examples to build consistent, accessible NHS services for the public and staff.

Heading

These examples are used for automated tests and may not follow service manual best practice.

What is your full name?

Code

Markup

<h1 class="nhsuk-heading-l">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  size: "l"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading nhsuk-heading-l">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  classes: "nhsuk-heading-l"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading nhsuk-heading-l">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  classes: "nhsuk-heading-l",
  size: "s"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading-s">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  size: "s"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading-m">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  size: "m"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading-l">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  size: "l"
}) }}

What is your full name?

Code

Markup

<h1 class="nhsuk-heading-xl">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  size: "xl"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-s">
  <span class="nhsuk-caption">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: "About you",
  size: "s"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-m">
  <span class="nhsuk-caption-m">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: "About you",
  size: "m"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-l">
  <span class="nhsuk-caption-l">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: "About you",
  size: "l"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-xl">
  <span class="nhsuk-caption-xl">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: "About you",
  size: "xl"
}) }}

What is your home address?

About you
Code

Markup

<h1 class="nhsuk-heading-s">
  What is your home address?
</h1>
<span class="nhsuk-caption nhsuk-caption--bottom">
  About you
</span>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "after"
  },
  size: "s"
}) }}

What is your home address?

About you
Code

Markup

<h1 class="nhsuk-heading-m">
  What is your home address?
</h1>
<span class="nhsuk-caption-m nhsuk-caption--bottom">
  About you
</span>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "after"
  },
  size: "m"
}) }}

What is your home address?

About you
Code

Markup

<h1 class="nhsuk-heading-l">
  What is your home address?
</h1>
<span class="nhsuk-caption-l nhsuk-caption--bottom">
  About you
</span>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "after"
  },
  size: "l"
}) }}

What is your home address?

About you
Code

Markup

<h1 class="nhsuk-heading-xl">
  What is your home address?
</h1>
<span class="nhsuk-caption-xl nhsuk-caption--bottom">
  About you
</span>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "after"
  },
  size: "xl"
}) }}

What is your home address?

About you

Code

Markup

<h1 class="nhsuk-heading-l">
  What is your home address?
</h1>
<p class="nhsuk-caption-l nhsuk-caption--bottom">
  About you
</p>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "after",
    element: "p"
  },
  size: "l"
}) }}
About you

What is your home address?

Code

Markup

<span class="nhsuk-caption">
  About you
</span>
<h1 class="nhsuk-heading-s">
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "before"
  },
  size: "s"
}) }}
About you

What is your home address?

Code

Markup

<span class="nhsuk-caption-m">
  About you
</span>
<h1 class="nhsuk-heading-m">
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "before"
  },
  size: "m"
}) }}
About you

What is your home address?

Code

Markup

<span class="nhsuk-caption-l">
  About you
</span>
<h1 class="nhsuk-heading-l">
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "before"
  },
  size: "l"
}) }}
About you

What is your home address?

Code

Markup

<span class="nhsuk-caption-xl">
  About you
</span>
<h1 class="nhsuk-heading-xl">
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "before"
  },
  size: "xl"
}) }}

About you

What is your home address?

Code

Markup

<h2 class="nhsuk-caption-l">
  About you
</h2>
<h1 class="nhsuk-heading-l">
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "before",
    element: "h2"
  },
  size: "l"
}) }}

What is your home address? About you

Code

Markup

<h1 class="nhsuk-heading-s">
  What is your home address?
  <span class="nhsuk-caption nhsuk-caption--bottom">
    About you
  </span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "end"
  },
  size: "s"
}) }}

What is your home address? About you

Code

Markup

<h1 class="nhsuk-heading-m">
  What is your home address?
  <span class="nhsuk-caption-m nhsuk-caption--bottom">
    About you
  </span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "end"
  },
  size: "m"
}) }}

What is your home address? About you

Code

Markup

<h1 class="nhsuk-heading-l">
  What is your home address?
  <span class="nhsuk-caption-l nhsuk-caption--bottom">
    About you
  </span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "end"
  },
  size: "l"
}) }}

What is your home address? About you

Code

Markup

<h1 class="nhsuk-heading-xl">
  What is your home address?
  <span class="nhsuk-caption-xl nhsuk-caption--bottom">
    About you
  </span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "end"
  },
  size: "xl"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-s">
  <span class="nhsuk-caption">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "start"
  },
  size: "s"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-m">
  <span class="nhsuk-caption-m">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "start"
  },
  size: "m"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-l">
  <span class="nhsuk-caption-l">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "start"
  },
  size: "l"
}) }}

About you What is your home address?

Code

Markup

<h1 class="nhsuk-heading-xl">
  <span class="nhsuk-caption-xl">
    About you
  </span>
  What is your home address?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your home address?",
  caption: {
    text: "About you",
    placement: "start"
  },
  size: "xl"
}) }}

What to expect at A&E

Code

Markup

<h1 class="nhsuk-heading-l">
  What to expect at A&amp;E
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What to expect at A&E",
  size: "l"
}) }}

What is your full name?

Code

Markup

<h1 class="app-heading-s">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  className: "app-heading",
  size: "s"
}) }}

What is your full name?

Code

Markup

<h1 class="app-heading app-heading--s">
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  className: "app-heading",
  classPrefix: "app-heading--",
  size: "s"
}) }}

What to expect at A&E

Code

Markup

<h1 class="nhsuk-heading-l">
  What to expect at A&amp;E
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  html: "What to expect at A&amp;E",
  size: "l"
}) }}

Urgent and emergency care services What to expect at A&E

Code

Markup

<h1 class="nhsuk-heading-l">
  <span class="nhsuk-caption-l">
    Urgent and emergency care services
  </span>
  What to expect at A&amp;E
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  html: "What to expect at A&amp;E",
  caption: "Urgent and emergency care services",
  size: "l"
}) }}

What to expect at A&E

Code

Markup

<h1 class="nhsuk-heading-l">
  What to expect at A&amp;E
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{% call heading({
  size: "l"
}) -%}
What to expect at A&amp;E
{%- endcall %}

What to expect at A&E Urgent and emergency care services

Code

Markup

<h1 class="nhsuk-heading-l">
  What to expect at A&amp;E
  <span class="nhsuk-caption-l nhsuk-caption--bottom">
    Urgent and emergency care services
  </span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{% call heading({
  caption: {
    text: "Urgent and emergency care services",
    placement: "end"
  },
  size: "l"
}) -%}
What to expect at A&amp;E
{%- endcall %}

Urgent and emergency care services What to expect at A&E

Code

Markup

<h1 class="nhsuk-heading-l">
  <span class="nhsuk-caption-l">
    Urgent and emergency care services
  </span>
  What to expect at A&amp;E
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{% call heading({
  caption: {
    text: "Urgent and emergency care services",
    placement: "start"
  },
  size: "l"
}) -%}
What to expect at A&amp;E
{%- endcall %}

What is your full name?

Code

Markup

<h1>
  What is your full name?
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "What is your full name?",
  className: false
}) }}

Home address (Karen Francis)

Code

Markup

<h1 class="nhsuk-heading-l">
  Home address<span class="nhsuk-u-visually-hidden"> (Karen Francis)</span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "Home address",
  visuallyHiddenText: "(Karen Francis)",
  size: "l"
}) }}

About you Home address (Karen Francis)

Code

Markup

<h1 class="nhsuk-heading-l">
  <span class="nhsuk-caption-l">
    About you
  </span>
  Home address<span class="nhsuk-u-visually-hidden"> (Karen Francis)</span>
</h1>

Macro

{% from "heading/macro.njk" import heading -%}

{{ heading({
  text: "Home address",
  visuallyHiddenText: "(Karen Francis)",
  caption: "About you",
  size: "l"
}) }}