Class: UiBibz::Ui::Core::NavLink
Overview
Create a NavLink
This element is an extend of UiBibz::Ui::Core::Component.
Attributes
-
content
- Content of element -
options
- Options of element -
html_options
- Html Options of element
Options
You can add HTML attributes using the html_options
. You can
pass arguments in options attribute:
-
status
- State of élement with symbol value: (:active
) -
url
- String -
badge
- String -
link_html_options
- Hash
Signatures
UiBibz::Ui::Core::NavLink.new(content, = nil, = nil)
UiBibz::Ui::Core::NavLink.new( = nil, = nil) do
content
end
Examples
UiBibz::Ui::Core::NavLink.new(content, { badge: 15, url: '/', status: :active, link_html_options: { class: 'link1' }},{ class: 'test' }).render
UiBibz::Ui::Core::NavLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
'Home'
end.render
Instance Attribute Summary
Attributes inherited from Component
#content, #html_options, #options
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (NavLink) initialize(content = nil, options = nil, html_options = nil, &block)
constructor
See UiBibz::Ui::Core::Component.initialize.
-
- (Object) render
Render html tag.
Methods inherited from Component
#add_classes, #badge_html, #class_and_html_options, #glyph, #glyph_and_content_html, #glyph_with_space, #state
Methods inherited from Base
Constructor Details
- (NavLink) initialize(content = nil, options = nil, html_options = nil, &block)
See UiBibz::Ui::Core::Component.initialize
42 43 44 |
# File 'lib/ui_bibz/ui/core/nav/components/nav_link.rb', line 42 def initialize content = nil, = nil, = nil, &block super end |
Instance Method Details
- (Object) render
Render html tag
47 48 49 |
# File 'lib/ui_bibz/ui/core/nav/components/nav_link.rb', line 47 def render content_tag :li, content_htm, .merge({ role: 'presentation' }) end |