1. Component Guide
  2. Admin layout

Admin layout

A layout to be used by admin applications

Typically you’ll use this together with the layout header component and the layout footer component.

Because it is an entire HTML document, this component can only be previewed on a separate page.

Search for usage of this component on GitHub.

How it looks (preview) (preview all)

<!DOCTYPE html>
<html lang="en" class="govuk-template">
    <meta charset="utf-8" />
    <title>A page title - GOV.UK Publishing</title>
    <meta name="robots" content="noindex,nofollow,noimageindex">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="3cVaKxxto2jg5dks1VKm9YaekOcf8HvhJHgIdbOe0H5us7Rgw3G-8Gp7hybRdfqJMu-LdwRrE5bvvT4DhSOHwQ" />
    <link rel="icon" type="image/x-icon" href="/assets/govuk_publishing_components/favicon-production-3d29621e53fc949f82338b9efeaeaa1a803066deef2e8e6b390c23d79c21c90b.png" />
    <link rel="stylesheet" href="/assets/application-11dff2efa10fe76b7c0e51f283fce8a81831495a6840e3184a7fce6f2f92b2d6.css" media="all" />
    <script src="/assets/govuk_publishing_components/vendor/modernizr-a694b2e4420935261ee2a50f5702d93197f5207f75a24a6ecdae2bfea4a160a3.js"></script>
  <body class="gem-c-layout-for-admin govuk-template__body">
    <script nonce="rtXV536klmuo2kTAEmdtZQ==">
      document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');

      <!-- You probably want to use the header, main & footer components here -->

    <script src="/assets/application-a50c98a6ffd0c894f2e09631e88bdf1d41f6dbfd5651aea3febec058de05a45a.js"></script>

How to call this component

<%= render "govuk_publishing_components/components/layout_for_admin", {
  environment: "production",
  product_name: "Publishing",
  browser_title: "A page title"
} do %>
  <!-- You probably want to use the header, main & footer components here -->
<% end %>

Accessibility acceptance criteria

The layout template must:

  • have a lang attribute
  • contain a skip link
  • have a sensible page <title>