Module: CCS::FrontendHelpers::GovUKFrontend::Header

Included in:
CCS::FrontendHelpers::GovUKFrontend
Defined in:
lib/ccs/frontend_helpers/govuk_frontend/header.rb

Overview

GOV.UK Header

This helper is used for generating the header component from the GDS - Components - Header

Instance Method Summary collapse

Instance Method Details

#govuk_header(**options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Header component

Parameters:

  • navigation (Hash)

    options for the navigation section of the header. See Navigation#initialize for details of the options.

  • menu_button (Hash)

    options for the menu button in the header. See Navigation#initialize for details of the options.

  • service (Hash)

    options for the service name

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the header HTML

  • :container_classes (String)

    classes for the container

  • :homepage_url (String)

    URL of the homepage. Defaults to /

  • :product_name (String)

    product name, used when the product name follows on directly from ‘GOV.UK

  • :use_tudor_crown (Boolean)

    flag to use the new tudor crown for the GOV.UK Logo

  • :attributes (Hash)

    additional attributes that will added as part of the header HTML

Returns:

  • (ActiveSupport::SafeBuffer)


22
23
24
# File 'lib/ccs/frontend_helpers/govuk_frontend/header.rb', line 22

def govuk_header(**options)
  Components::GovUK::Header.new(context: self, **options).render
end