class NfgUi::Components::Elements::NavItem

Nav doc coming soon

Public Instance Methods

render() { |: body)), active: active, disabled: disabled, dropdown: dropdown, tab: tab, remote: remote, href: (tab || href), icon: icon| ... } click to toggle source
# File lib/nfg_ui/components/elements/nav_item.rb, line 20
def render
  content_tag(as, html_options) do
    if include_nav_link?
      concat(NfgUi::Components::Elements::NavLink.new({ body: (button ? button : (block_given? ? yield : body)), active: active, disabled: disabled, dropdown: dropdown, tab: tab, remote: remote, href: (tab || href), icon: icon }, view_context).render)
      if dropdown
        concat(block_given? ? yield : body)
      end
    else
      if icon
        NfgUi::Components::Foundations::Icon.new({ traits: [icon], text: (block_given? ? yield : body) }, view_context).render
      else
        (block_given? ? yield : body)
      end
    end
  end
end