Class: Ui::Skeleton::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/uikit_rails/templates/components/skeleton/component.rb

Overview

Animated placeholder for loading states.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (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_attrsObject (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

#roundedObject (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

#widthObject (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

#callObject



17
18
19
# File 'lib/uikit_rails/templates/components/skeleton/component.rb', line 17

def call
  tag.div(**computed_attrs)
end