Module: CCS::FrontendHelpers::GovUKFrontend::TaskList

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

Overview

GOV.UK Task list

This helper is used for generating the task list component from the GDS - Components - Task list

Instance Method Summary collapse

Instance Method Details

#govuk_task_list(task_list_items, **options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Task list component

Parameters:

  • task_list_items (Array<Hash>)

    An array of task list items. See Item#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 task list HTML

  • :id_prefix (Sting)

    id prefix for the task list, defaults to ‘task-list’

  • :attributes (Hash)

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


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

def govuk_task_list(task_list_items, **options)
  Components::GovUK::TaskList.new(context: self, task_list_items: task_list_items, **options).render
end