Class: UI::SpinnerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SpinnerComponent
- Includes:
- SpinnerBehavior
- Defined in:
- app/view_components/ui/spinner_component.rb
Overview
SpinnerComponent - ViewComponent implementation
A loading indicator component using an animated spinner icon. Uses SpinnerBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(size: "default", classes: "", **attributes) ⇒ SpinnerComponent
constructor
A new instance of SpinnerComponent.
Methods included from SpinnerBehavior
#spinner_classes, #spinner_html_attributes
Constructor Details
#initialize(size: "default", classes: "", **attributes) ⇒ SpinnerComponent
Returns a new instance of SpinnerComponent.
19 20 21 22 23 |
# File 'app/view_components/ui/spinner_component.rb', line 19 def initialize(size: "default", classes: "", **attributes) @size = size @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 |
# File 'app/view_components/ui/spinner_component.rb', line 25 def call content_tag :svg, **spinner_html_attributes.merge(@attributes).merge(svg_attributes) do tag.path(d: "M21 12a9 9 0 1 1-6.219-8.56") end end |