Admin layout example
With type module
Adds ‘type=module’ to the javascript_include_tag. By default, use_type_module is false.
How it looks (preview)
<!DOCTYPE html>
<html lang="en" class="govuk-template govuk-template--rebranded">
<head>
<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">
<link rel="icon" type="image/x-icon" href="/assets/collections/govuk_publishing_components/favicon-production-f24c2313e8823e049575a8960114d0c48d6638f023ce171650bc471aa7ab420c.png" />
<link rel="stylesheet" href="/assets/collections/application-df86e341c9761d232708af2a56454d14b75d76269eb2062a90c1a57cf5c43fff.css" media="all" />
</head>
<body class="gem-c-layout-for-admin govuk-template__body">
<script nonce="0pg8s4nhsEt5V6OVqihCxg==">
//<![CDATA[
document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');
//]]>
</script>
<!-- You probably want to use the header, main & footer components here -->
<script src="/assets/collections/application-d8e8ebbe2385e05c70c136ad4e367e369f0f19d6ab946d2491b0af82e7ad15e5.js" type="module"></script>
</body>
</html>
How to call this example
<%= render "govuk_publishing_components/components/layout_for_admin", {
environment: "production",
product_name: "Publishing",
browser_title: "A page title",
use_type_module: true
} do %>
<!-- You probably want to use the header, main & footer components here -->
<% end %>