Class: NfgUi::Components::Patterns::TileHeader
- Inherits:
-
Base
- Object
- Bootstrap::Components::Base
- Base
- NfgUi::Components::Patterns::TileHeader
- Defined in:
- lib/nfg_ui/components/patterns/tile_header.rb
Overview
TileHeader doc coming soon
Constant Summary
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 Utilities::Iconable
Methods included from Utilities::Titleable
Methods included from Bootstrap::Utilities::Collapsible
#collapse, #collapsed, #collapsible
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods inherited from Bootstrap::Components::Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
13 14 15 |
# File 'lib/nfg_ui/components/patterns/tile_header.rb', line 13 def component_family :tile end |
#render ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nfg_ui/components/patterns/tile_header.rb', line 17 def render super do if collapsible && title concat(NfgUi::Components::Elements::Button.new({ traits: [:link, :block], collapse: collapse, class: 'no-link-color p-0 m-0' }, view_context).render { content_tag(:div, class: 'row align-items-center') do concat(content_tag(:div, class: 'col-10 text-left') { NfgUi::Components::Foundations::Typeface.new({ heading: title, icon: icon, class: 'h4' }, view_context).render }) concat(content_tag(:div, class: 'col-2 text-right') { NfgUi::Components::Foundations::Icon.new({ traits: ['caret-down fw'], tooltip: 'Show / hide additional information' }, view_context).render }) end }) elsif title concat(NfgUi::Components::Foundations::Typeface.new({ heading: title, icon: icon, class: 'h4' }, view_context).render) end concat((block_given? ? yield : body)) end end |