Module: CCS::FrontendHelpers::GovUKFrontend::StepByStepNavigation

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

Overview

GOV.UK Step by step navigation

This helper is used for generating the Step by step navigation component from the / GDS - Pages - Step by step navigation

To use this component you need the following from GOV.UK Publishing Components. For the SCSS components you should add:

For the JavaScript you should add:

Instance Method Summary collapse

Instance Method Details

#govuk_step_by_step_navigation(step_by_step_navigation_sections, **options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Step by step navigation component

Parameters:

  • step_by_step_navigation_sections (Array<Hash>)

    An array of options for the step by step navigation section. See Section#initialize for details of the items in the array.

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the step by step navigation HTML

  • :attributes (Hash) — default: {}

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


30
31
32
# File 'lib/ccs/frontend_helpers/govuk_frontend/step_by_step_navigation.rb', line 30

def govuk_step_by_step_navigation(step_by_step_navigation_sections, **options)
  Components::GovUK::StepByStepNavigation.new(context: self, step_by_step_navigation_sections: step_by_step_navigation_sections, **options).render
end