--- url: "https://design-system.service.gov.uk/components/generic-header" titulek: "Generic header – GOV.UK Design System" h1: "Generic header" popis: "A generic header to help services not on GOV.UK" jazyk: "en" kanonicka: "https://design-system.service.gov.uk/components/generic-header/" drobecky: ["Home", "Components"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 02:11:54" znaku: 6187 slov: 818 kodovani: "utf-8" sha256: "b1e765572928d37d5e1e86b11272f07104ab971e64328044b80dcfd1c8799349" --- # Generic header Use this generic version of the header to tell users they’re using a government service that’s not part of the GOV.UK website. - HTML - Nunjucks HTML ```
``` Nunjucks Nunjucks macro options Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text. Some options are required for the macro to work; these are marked as “Required” in the option description. Deprecated options are marked as “Deprecated”. If you’re using Nunjucks macros in production with “html” options, or ones ending with “html”, you must sanitise the HTML to protect against [cross-site scripting exploits](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Primary options string The URL of the logo link. Defaults to the root of the current web domain (“/”). string **Required.** If `logoHtml` is set, this is not required. Text content for the logo section of the Generic header. string **Required.** If `logoText` is set, this is not required. HTML content for the logo section of the Generic header. string Classes for the container. Useful if you want to make the Generic header fixed width. string Classes to add to the Generic header container. object HTML attributes (for example, data attributes) to add to the Generic header container. ``` {% from "govuk/components/generic-header/macro.njk" import govukGenericHeader %} {% set logoContent %} Service name {% endset %} {{ govukGenericHeader({ url: "#", logoHtml: logoContent }) }} ``` ## When to use this component Use the Generic header component if your service is both: - a public-facing government service - not on the GOV.UK website (meaning that your service is not part of the [GOV.UK proposition](https://www.gov.uk/government/publications/govuk-proposition/govuk-proposition) ) This is to bring consistency and maintain user trust in journeys that move between the GOV.UK website and other government websites and services. This component also helps ensure your non-GOV.UK service does not: - identify itself as being part of GOV.UK - use the crown or GOV.UK logotype in the header - use the GDS Transport typeface - use the [GOV.UK brand colours](https://brand.design-system.service.gov.uk/colour/govuk-blue/) See the guidance on [if your service is not on GOV.UK in the Service manual](https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk). ## When not to use this component If your service is hosted on one of these gov.uk domains, you must use the [GOV.UK header component](/components/header/) instead: - gov.uk/[myservice] - [myservice].service.gov.uk - [myblog].blog.gov.uk ## How it works If you use the [page template](/styles/page-template/), you’ll first need to replace the default GOV.UK header in the page template with the Generic header component. Use the Generic header component to display your own: - brand logo - homepage link - font for your service name (instead of GDS Transport) You must also follow the steps in the [Using GOV.UK Frontend without GOV.UK branding guidance](https://frontend.design-system.service.gov.uk/using-govuk-frontend-without-govuk-branding/) to remove other GOV.UK brand elements elsewhere in your service. ### Using your own brand logo Follow your organisation’s guidelines and best practice to show your brand logo. To make your logo image as accessible and optimised as possible, also see: - Design System guidance on [using images](/styles/images/) - [Image guidance for GOV.UK content and publishers](https://guidance.publishing.service.gov.uk/formatting-content/images/) ### Homepage link By default, the homepage link points to `/`, which is the top level of your service’s domain. You should customise the link to point to wherever makes the most sense for your service. As with the GOV.UK header component, you should not use the Generic header component to show navigation links. Use the [Service navigation component](/components/service-navigation) instead to let users navigate to different parts of your service and find useful links and tools. ## Research on this component When developing this component, we worked with a cross-government working group representing various government departments that work on services not hosted on GOV.UK. We thank them for their work to gather the needs and considerations for consistent headers across all government services. ## Recent changes | Jun 2026 | [GOV.UK Frontend v6.3.0](https://github.com/alphagov/govuk-frontend/releases/tag/v6.3.0) | Component introduced. | | --- | --- | --- | [View full change history](/components/generic-header/history/) ## Help improve this component To help make sure that this page is useful, relevant and up to date, you can: - take part in the [‘Generic header’ discussion on GitHub](https://github.com/alphagov/govuk-design-system-backlog/issues/185) and share your research - [propose a change on GitHub](https://github.com/alphagov/govuk-design-system/edit/main/src/components/generic-header/index.md) – read more about [how to propose changes in GitHub](/community/propose-a-content-change-using-github/) ## Need help? If you’ve got a question about the GOV.UK Design System, [contact the team](/contact/).