Class: BetterUi::ProgressComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/better_ui/progress_component.rb

Constant Summary collapse

SIZES =
{
  xs: "h-1",
  sm: "h-2",
  md: "h-3",
  lg: "h-4"
}.freeze

Constants inherited from ApplicationComponent

ApplicationComponent::SHADOWS, ApplicationComponent::VARIANTS, ApplicationComponent::VARIANT_BODY_DIVIDE, ApplicationComponent::VARIANT_DIVIDE, ApplicationComponent::VARIANT_HEADER_BG, ApplicationComponent::VARIANT_HEADER_TEXT, ApplicationComponent::VARIANT_HIGHLIGHTED, ApplicationComponent::VARIANT_HOVERABLE, ApplicationComponent::VARIANT_RING, ApplicationComponent::VARIANT_SORT_ICON, ApplicationComponent::VARIANT_STRIPED

Instance Method Summary collapse

Constructor Details

#initialize(value: 0, max: 100, variant: :primary, size: :md, label: nil, show_value: false, animated: false, container_classes: nil, **options) ⇒ ProgressComponent

Returns a new instance of ProgressComponent.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/better_ui/progress_component.rb', line 12

def initialize(
  value: 0,
  max: 100,
  variant: :primary,
  size: :md,
  label: nil,
  show_value: false,
  animated: false,
  container_classes: nil,
  **options
)
  @value = value
  @max = max
  @variant = validate_variant(variant)
  @size = validate_size(size)
  @label = label
  @show_value = show_value
  @animated = animated
  @container_classes = container_classes
  @options = options
end