Class: UiBibz::Ui::Core::DropdownHeader

Inherits:
Component show all
Defined in:
lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb

Overview

Create DropdownHeader

This element is an extend of UiBibz::Ui::Core::Component. Use '—' in content to add a separator

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.

Signatures

UiBibz::Ui::Core::DropdownHeader.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::DropdownHeader.new(options = nil, html_options = nil) do
  content
end

Examples

UiBibz::Ui::Core::DropdownHeader.new('Home',{ class: 'test' }).render

UiBibz::Ui::Core::DropdownHeader.new({ class: 'test' }) do
  'Home'
end.render

Instance Attribute Summary

Attributes inherited from Component

#content, #html_options, #options

Attributes inherited from Base

#output_buffer

Instance Method Summary (collapse)

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

#i18n_set?

Constructor Details

- (DropdownHeader) initialize(content = nil, options = nil, html_options = nil, &block)

See UiBibz::Ui::Core::Component.initialize



37
38
39
# File 'lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb', line 37

def initialize content = nil, options = nil, html_options = nil, &block
  super
end

Instance Method Details

- (Object) render

Render html tag



42
43
44
# File 'lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb', line 42

def render
   :li, @content, class_and_html_options('dropdown-header').merge({ role: 'presentation' })
end