Class: UI::Spinner
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::Spinner
- Includes:
- SpinnerBehavior
- Defined in:
- app/components/ui/spinner.rb
Overview
Spinner - Phlex implementation
A loading indicator component using an animated spinner icon. Uses SpinnerBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(size: "default", classes: "", **attributes) ⇒ Spinner
constructor
A new instance of Spinner.
- #view_template ⇒ Object
Methods included from SpinnerBehavior
#spinner_classes, #spinner_html_attributes
Constructor Details
#initialize(size: "default", classes: "", **attributes) ⇒ Spinner
Returns a new instance of Spinner.
19 20 21 22 23 |
# File 'app/components/ui/spinner.rb', line 19 def initialize(size: "default", classes: "", **attributes) @size = size @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/components/ui/spinner.rb', line 25 def view_template svg( **spinner_html_attributes.merge(@attributes), xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", stroke_width: "2", stroke_linecap: "round", stroke_linejoin: "round" ) do |s| s.path(d: "M21 12a9 9 0 1 1-6.219-8.56") end end |