class NfgUi::Components::Elements::StepIndicator

Step doc coming soon

Public Instance Methods

component_family() click to toggle source
# File lib/nfg_ui/components/elements/step_indicator.rb, line 10
def component_family
  :steps
end
render() { |: body), class: 'mt-1 mb-0 step-text'| ... } click to toggle source
# File lib/nfg_ui/components/elements/step_indicator.rb, line 18
def render
  content_tag(as, html_options) do
    concat(content_tag(:div, class: 'step-indicator') {
      if icon
        NfgUi::Components::Foundations::Icon.new({ traits: [icon] }, view_context).render
      else
        step
      end
    })
    concat(NfgUi::Components::Foundations::Typeface.new({ traits: [:muted], caption: (block_given? ? yield : body), class: 'mt-1 mb-0 step-text' }, view_context).render) if (block_given? || body.present?)
  end
end
step() click to toggle source
# File lib/nfg_ui/components/elements/step_indicator.rb, line 14
def step
  options.fetch(:step, nil)
end

Private Instance Methods

default_html_wrapper_element() click to toggle source

Become a :span if :href is not present in options.

While span is the defined default_html_wrapper_element in Bootstrap::Utilities::Wrappable, We set :span explicitly here because to ensure that regardless of what the default wrapper becomes, :span is preserved.

# File lib/nfg_ui/components/elements/step_indicator.rb, line 37
def default_html_wrapper_element
  :span
end
non_html_attribute_options() click to toggle source
# File lib/nfg_ui/components/elements/step_indicator.rb, line 41
def non_html_attribute_options
  super.push(:step)
end