Sha256: 6d170a3bbf33c9e67662eb494a149ec507b8057660c8acd26f251269c6cf1ee5

Contents?: true

Size: 851 Bytes

Versions: 2

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

require_relative '../../components/govuk/label'

module CCS
  module FrontendHelpers
    module GovUKFrontend
      # = GOV.UK label
      #
      # This helper is used for generating the label component from the Government Design Systems

      module Label
        # Generates the HTML for the GOV.UK label component
        #
        # @param (see CCS::Components::GovUK::Label#initialize)
        #
        # @option (see CCS::Components::GovUK::Label#initialize)
        #
        # @yield (see CCS::Components::GovUK::Label#render)
        #
        # @return (see CCS::Components::GovUK::Label#render)

        def govuk_label(attribute, text = nil, **options, &)
          Components::GovUK::Label.new(context: self, attribute: attribute, text: text, **options).render(&)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ccs-frontend_helpers-2.1.0 lib/ccs/frontend_helpers/govuk_frontend/label.rb
ccs-frontend_helpers-2.0.0 lib/ccs/frontend_helpers/govuk_frontend/label.rb