Class: UiBibz::Ui::Core::Bar
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:
-
state - State of élement with symbol value: (:default, :primary, :info, :warning, :danger)
-
label - String (default: “percentage%”)
-
percentage_min - Integer (default: 0)
-
percentage_max - Integer (default: 100)
-
sr_only - Boolean to show label (default: false)
-
type (:striped, :animated)
Signatures
UiBibz::Ui::Core::Bar.new(percentage, = nil, = nil)
UiBibz::Ui::Core::Bar.new( = nil, = nil) do
percentage
end
Examples
UiBibz::Ui::Core::Bar.new(10)
# or
UiBibz::Ui::Core::Bar.new(10, { state: :success, sr_only: true, label: 'Loading...' },{ class: 'test' }).render
# or
UiBibz::Ui::Core::Bar.new({ state: :primary }) do
40
end.render
Instance Attribute Summary
Attributes inherited from Component
#content, #html_options, #options
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Bar) 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
Methods inherited from Base
Constructor Details
- (Bar) initialize(content = nil, options = nil, html_options = nil, &block)
See UiBibz::Ui::Core::Component.initialize
47 48 49 |
# File 'lib/ui_bibz/ui/core/progress_bar/components/bar.rb', line 47 def initialize content = nil, = nil, = nil, &block super end |
Instance Method Details
- (Object) render
Render html tag
52 53 54 |
# File 'lib/ui_bibz/ui/core/progress_bar/components/bar.rb', line 52 def render content_tag :div, , (['progress-bar', type]).merge() end |