Class: UiBibz::Ui::Core::Jumbotron

Inherits:
Component show all
Defined in:
lib/ui_bibz/ui/core/jumbotron.rb

Overview

Create a jumbotron

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:

  • full_with - Boolean to render jumbotron in fullscreen

Signatures

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

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

Examples

UiBibz::Ui::Core::Jumbotron.new(content, full_width: true).render

UiBibz::Ui::Core::Jumbotron.new() do
  #content
end.render

Helper

jumbotron(content, options = {} , html_options = {})

jumbotron(options = {}, html_options = {}) do
  content
end

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

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

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



46
47
48
# File 'lib/ui_bibz/ui/core/jumbotron.rb', line 46

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

Instance Method Details

- (Object) render

Render html tag



51
52
53
54
55
56
57
58
59
# File 'lib/ui_bibz/ui/core/jumbotron.rb', line 51

def render
   :div, class_and_html_options('jumbotron') do
    if full_width
       :div, @content, class: 'container'
    else
      @content
    end
  end
end