Class: UiBibz::Ui::Core::Windows::Offcanvas

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

Overview

Create a offcanvas

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 - status of element with symbol value: (:primary, :secondary, :info, :warning, :danger)

  • size - Size of element with symbol value: (:xs, :sm, :lg)

  • position - Position vertical or horizontal with symbol value: (:vertical, :horizontal)

Signatures

UiBibz::Ui::Core::Windows::Offcanvas.new(options = nil, html_options = nil) do |bt|
  ...
end

Examples

Constant Summary

Constants inherited from Component

Component::BREAKPOINTS, Component::SIZES, Component::STATUSES

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

#initialize, #render

Methods included from GlyphExtension

#glyph_and_content_html

Methods included from KlassExtension

#exclude_classes, #exclude_classes_in_html_options, #join_classes, #status

Methods inherited from Base

#generate_id, #i18n_set?, #inject_url

Constructor Details

This class inherits a constructor from UiBibz::Ui::Core::Component

Instance Method Details

#body(content = nil, options = nil, html_options = nil) ⇒ Object



48
49
50
# File 'lib/ui_bibz/ui/core/windows/offcanvas.rb', line 48

def body(content = nil, options = nil, html_options = nil, &)
  @body = UiBibz::Ui::Core::Windows::Components::OffcanvasBody.new(content, options, html_options, &)
end

#header(content = nil, options = nil, html_options = nil) ⇒ Object



44
45
46
# File 'lib/ui_bibz/ui/core/windows/offcanvas.rb', line 44

def header(content = nil, options = nil, html_options = nil, &)
  @header = UiBibz::Ui::Core::Windows::Components::OffcanvasHeader.new(content, options, html_options, &)
end

#pre_renderObject

Render html tag



37
38
39
40
41
42
# File 'lib/ui_bibz/ui/core/windows/offcanvas.rb', line 37

def pre_render
   :div, html_options do
    concat @header&.render
    concat @body&.render
  end
end