Class: UI::Progress
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::Progress
- Includes:
- ProgressBehavior
- Defined in:
- app/components/ui/progress.rb
Overview
Progress - Phlex implementation
A progress indicator component for displaying task completion or loading status. Uses ProgressBehavior for shared styling logic.
Instance Method Summary collapse
-
#initialize(value: 0, classes: "", **attributes) ⇒ Progress
constructor
A new instance of Progress.
- #view_template ⇒ Object
Methods included from ProgressBehavior
#progress_classes, #progress_html_attributes, #progress_indicator_classes, #progress_indicator_style, #progress_value
Constructor Details
#initialize(value: 0, classes: "", **attributes) ⇒ Progress
Returns a new instance of Progress.
22 23 24 25 26 |
# File 'app/components/ui/progress.rb', line 22 def initialize(value: 0, classes: "", **attributes) @value = value @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/components/ui/progress.rb', line 28 def view_template div(**progress_html_attributes.deep_merge(@attributes)) do div( class: progress_indicator_classes, style: progress_indicator_style, data: {slot: "progress-indicator"} ) end end |