Module: CCS::FrontendHelpers::GovUKFrontend::InsetText

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

Overview

GOV.UK Inset Text

This helper is used for generating the inset text component from the GDS - Components - Inset text

Instance Method Summary collapse

Instance Method Details

#govuk_inset_text(text = nil) { ... } ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Inset text component

Parameters:

  • text (String) (defaults to: nil)

    text to use within the inset text 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 inset text div. Ignored if inset text is given

Returns:

  • (ActiveSupport::SafeBuffer)


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

def govuk_inset_text(text = nil, **, &)
  Components::GovUK::InsetText.new(context: self, text: text, **).render(&)
end