class UiBibz::Ui::Core::Navigations::NavText

Create a NavLinkLink

This element is an extend of UiBibz::Ui::Core::Component.

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Public Instance Methods

pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/navigations/components/nav_text.rb, line 25
def pre_render
  options[:nav_type] == 'nav-links' ? content_html : content_tag(:li, content_html, class: 'nav-item nav-text')
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/navigations/components/nav_text.rb, line 38
def component_html_classes
  'nav-link'
end
component_html_options() click to toggle source
# File lib/ui_bibz/ui/core/navigations/components/nav_text.rb, line 42
def component_html_options
  options[:nav_type] == 'nav-tabs' ? { 'data-bs-toggle' => 'tab', role: 'tab' } : {}
end
content_html() click to toggle source
# File lib/ui_bibz/ui/core/navigations/components/nav_text.rb, line 31
def content_html
  content_tag :span, html_options do
    concat glyph_and_content_html
    concat tag_html if options[:tag]
  end
end