Class: Ui::Skeleton::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Skeleton::Component
- Defined in:
- lib/uikit_rails/templates/components/skeleton/component.rb
Overview
Animated placeholder for loading states.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#html_attrs ⇒ Object
readonly
Returns the value of attribute html_attrs.
-
#rounded ⇒ Object
readonly
Returns the value of attribute rounded.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(width: nil, height: nil, rounded: true, **html_attrs) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(width: nil, height: nil, rounded: true, **html_attrs) ⇒ Component
Returns a new instance of Component.
9 10 11 12 13 14 15 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 9 def initialize(width: nil, height: nil, rounded: true, **html_attrs) @width = width @height = height @rounded = rounded @html_attrs = html_attrs super() end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
7 8 9 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 7 def height @height end |
#html_attrs ⇒ Object (readonly)
Returns the value of attribute html_attrs.
7 8 9 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 7 def html_attrs @html_attrs end |
#rounded ⇒ Object (readonly)
Returns the value of attribute rounded.
7 8 9 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 7 def rounded @rounded end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 7 def width @width end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 17 def call tag.div(**computed_attrs) end |