Module: CCS::FrontendHelpers::GovUKFrontend::Panel

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

Overview

GOV.UK Panel

This helper is used for generating the panel component from the GDS - Components - Panel

Instance Method Summary collapse

Instance Method Details

#govuk_panel(title_text, panel_text = nil) { ... } ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Panel component

Parameters:

  • title_text (String)

    title text for the panel which will be contained in haeding tags

  • panel_text (String) (defaults to: nil)

    text to use within the panel component. If nil, then a block will be rendered

  • options (Hash)

    options that will be used in customising the HTML

Yields:

  • HTML that will be contained within the panel body. Ignored if panel text is given

Returns:

  • (ActiveSupport::SafeBuffer)


24
25
26
# File 'lib/ccs/frontend_helpers/govuk_frontend/panel.rb', line 24

def govuk_panel(title_text, panel_text = nil, **, &)
  Components::GovUK::Panel.new(context: self, title_text: title_text, panel_text: panel_text, **).render(&)
end