Class: NfgUi::Components::Patterns::Collapse

Overview

Button Group doesn’t have any customizations unique to the design system yet As such, the NFG UI button group is simply a bootstrap button group behind the scenes. Traits will eventually be connected here.

Constant Summary

Constants included from Traits::Collapse

Traits::Collapse::TRAITS

Constants included from Traits

Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES

Instance Attribute Summary

Attributes inherited from Bootstrap::Components::Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Traits::Collapse

#collapsed_trait, #collapsible_trait, #navbar_trait

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Describable

#data, #describe

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods included from Bootstrap::Utilities::Headable

#heading

Methods inherited from Bootstrap::Components::Collapse

#navbar

Methods included from Bootstrap::Utilities::Collapsible

#collapse, #collapsed, #collapsible

Methods inherited from Bootstrap::Components::Base

#component_family, #data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#renderObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/nfg_ui/components/patterns/collapse.rb', line 18

def render
  capture do
    if heading
      opts = { collapse: "##{id}", body: heading, icon: 'caret-down', class: 'pl-0 text-left' }
      opts.merge!(traits: [:link, :block])
      concat(NfgUi::Components::Elements::Button.new(opts, view_context).render)
    end
    concat(super)
  end
end