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