Class: Pulse::ProgressBar
- Inherits:
-
Component
- Object
- Component
- Pulse::ProgressBar
- Defined in:
- app/components/pulse/progress_bar.rb
Overview
Renders a simple progress bar
Instance Method Summary collapse
-
#initialize(percentage: 0, **system_attributes) ⇒ ProgressBar
constructor
A new instance of ProgressBar.
Constructor Details
#initialize(percentage: 0, **system_attributes) ⇒ ProgressBar
Returns a new instance of ProgressBar.
6 7 8 9 10 11 12 13 14 15 |
# File 'app/components/pulse/progress_bar.rb', line 6 def initialize(percentage: 0, **system_attributes) @percentage = percentage.to_i @system_attributes = system_attributes @system_attributes[:tag] ||= :div @system_attributes[:class] = merge_classes( 'pulse-flex pulse-flex-row pulse-h-1 pulse-w-full pulse-bg-gray-300', 'dark:pulse-bg-gray-600', system_attributes[:classes] ) end |