class NfgUi::Components::Patterns::Tile

Tile doc coming soon

Public Instance Methods

button() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 19
def button
  options.fetch(:button, nil)
end
component_family() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 27
def component_family
  :tile
end
heading() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 15
def heading
  options.fetch(:heading, nil)
end
href() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 23
def href
  options.fetch(:href, nil)
end
render() { |: body)| ... } click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 35
def render
  super do
    if render_in_body
      if title.present?
        concat(NfgUi::Components::Patterns::TileHeader.new({ title: title, subtitle: subtitle, button: button, href: href, icon: icon, collapsible: collapsible, collapsed: collapsed, collapse: ("#collapse_#{id}" if collapsible) }, view_context).render)
      end
      if collapsible
        concat(NfgUi::Components::Patterns::Collapse.new({ id: "collapse_#{id}", collapsed: collapsed }, view_context).render {
          NfgUi::Components::Patterns::TileBody.new({ heading: heading }, view_context).render do
            (block_given? ? yield : body)
          end
        })
      else
        concat(NfgUi::Components::Patterns::TileBody.new({ heading: heading }, view_context).render {
          (block_given? ? yield : body)
        })
      end
    else
      (block_given? ? yield : body)
    end
  end
end
render_in_body() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 31
def render_in_body
  options.fetch(:render_in_body, true)
end
subtitle() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 58
def subtitle
  options.fetch(:subtitle, nil)
end

Private Instance Methods

non_html_attribute_options() click to toggle source
# File lib/nfg_ui/components/patterns/tile.rb, line 64
def non_html_attribute_options
  super.push(:heading, :render_in_body, :subtitle, :button, :href)
end