Layout footer
The footer provides copyright, licensing and other information
How it looks (preview) (preview all)
How to call this component
<%= render "govuk_publishing_components/components/layout_footer", {} %>
GOV.UK Design System
This component incorporates components from the GOV.UK Design System:
Accessibility acceptance criteria
Text and links in the Footer must:
- have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
Images in the Footer must:
- be presentational when linked to from accompanying text “Open Government Licence (OGL) icon”.
Landmarks and Roles in the Footer should:
-
avoid navigation landmarks or roles
The footer element alone is sufficient for such cases; while a
nav
element can be used, it is usually unnecessary.Note: This decision has been made based on prior experience seeing removal of overuse of
<nav>
elements from www.GOV.UK, which made it confusing for users of assistive technologies to know what were the most important navigation aspects of GOV.UK. Should be challenged if user research indicates this is an issue. -
have a role of
contentinfo
at the root of the component (<footer>
)Note: This decision has been made given that most uses of this role tend to be used directly on a
<footer>
element. Assumption made is that is most predictable for users of assistive technologies. The spec indicates thatcontentinfo
is useful for “Examples of information included in this region of the page are copyrights and links to privacy statements.”, which may indicate that it might be better placed around the ‘meta’ section of this component. Should be challenged if user research indicates this is an issue.
Links in the component must:
- accept focus
- be focusable with a keyboard
- be usable with a keyboard
- indicate when they have focus
- change in appearance when touched (in the touch-down state)
- change in appearance when hovered
- be usable with touch
- be usable with voice commands
- have visible text
- have meaningful text
Other examples
Standard options
This component uses the component wrapper helper. It accepts the following options and applies them to the parent element of the component. See the component wrapper helper documentation for more detail.
id
- accepts a string for the element ID attributedata_attributes
- accepts a hash of data attributesaria
- accepts a hash of aria attributesclasses
- accepts a space separated string of classes, these should not be used for styling and must be prefixed withjs-
margin_bottom
- accepts a number from0
to9
(0px
to60px
) using the GOV.UK Frontend spacing scale (defaults to no margin)role
- accepts a space separated string of roleslang
- accepts a language attribute valueopen
- accepts an open attribute value (true or false)hidden
- accepts an empty string, ‘hidden’, or ‘until-found’tabindex
- accepts an integer. The integer can also be passed as a string.dir
- accepts ‘rtl’, ‘ltr’, or ‘auto’.
With meta (preview)
<%= render "govuk_publishing_components/components/layout_footer", {
meta: {
items: [
{
href: "/help",
text: "Help"
},
{
href: "/help/privacy-notice",
text: "Privacy"
},
{
href: "/help/cookies",
text: "Cookies"
},
{
href: "/contact",
text: "Contact"
},
{
href: "/help/accessibility-statement",
text: "Accessibility statement"
},
{
href: "/help/terms-conditions",
text: "Terms and conditions"
},
{
href: "/cymraeg",
text: "Rhestr o Wasanaethau Cymraeg"
},
{
href: "/government/organisations/government-digital-service",
text: "Government Digital Service"
}
]
}
} %>
With attributes links (preview)
<%= render "govuk_publishing_components/components/layout_footer", {
navigation: [
{
title: "Test Links",
columns: 1,
items: [
{
href: "https://www.gov.uk/government/collections/organisation",
text: "Shows a page in a new window",
attributes: {
target: "_blank",
rel: "noopener"
}
},
{
href: "https://www.gov.uk/corporation-tax",
text: "Shows page in the same window",
attributes: {
data: {
tracking: "GTM-123AB"
}
}
}
]
}
],
meta: {
items: [
{
href: "/cymraeg",
text: "Rhestr o Wasanaethau Cymraeg",
attributes: {
lang: "en",
hreflang: "en"
}
}
]
}
} %>
With border (preview)
<%= render "govuk_publishing_components/components/layout_footer", {
with_border: true,
meta: {
items: [
{
href: "/help",
text: "Help"
},
{
href: "/help/privacy-notice",
text: "Privacy"
},
{
href: "/help/cookies",
text: "Cookies"
},
{
href: "/contact",
text: "Contact"
},
{
href: "/help/accessibility-statement",
text: "Accessibility statement"
},
{
href: "/help/terms-conditions",
text: "Terms and conditions"
},
{
href: "/cymraeg",
text: "Rhestr o Wasanaethau Cymraeg"
},
{
href: "/government/organisations/government-digital-service",
text: "Government Digital Service"
}
]
}
} %>
Without licence details (preview)
In some limited circumstances (for example, in backend-facing admin systems) it doesn’t make
sense to show the licence information. This can be hidden by setting hide_licence
to true
.
<%= render "govuk_publishing_components/components/layout_footer", {
hide_licence: true
} %>