Class: Pajamas::SpinnerComponent
- Defined in:
- app/components/pajamas/spinner_component.rb
Constant Summary collapse
- COLOR_OPTIONS =
[:light, :dark].freeze
- SIZE_OPTIONS =
[:sm, :md, :lg, :xl].freeze
Instance Method Summary collapse
-
#initialize(color: :dark, inline: false, label: _("Loading"), size: :sm, **html_options) ⇒ SpinnerComponent
constructor
A new instance of SpinnerComponent.
Constructor Details
#initialize(color: :dark, inline: false, label: _("Loading"), size: :sm, **html_options) ⇒ SpinnerComponent
Returns a new instance of SpinnerComponent.
9 10 11 12 13 14 15 |
# File 'app/components/pajamas/spinner_component.rb', line 9 def initialize(color: :dark, inline: false, label: _("Loading"), size: :sm, **) @color = filter_attribute(color.to_sym, COLOR_OPTIONS) @inline = inline @label = label.presence @size = filter_attribute(size.to_sym, SIZE_OPTIONS) @html_options = end |