Class: SolidWebUi::Ui::StatCardComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/solid_web_ui/ui/stat_card_component.rb

Overview

A single dashboard metric: a label and a (usually numeric) value, optionally toned (neutral/primary/success/warning/danger) and linkable.

Instance Method Summary collapse

Constructor Details

#initialize(label:, value:, tone: :neutral, href: nil) ⇒ StatCardComponent

Returns a new instance of StatCardComponent.



8
9
10
11
12
13
# File 'app/components/solid_web_ui/ui/stat_card_component.rb', line 8

def initialize(label:, value:, tone: :neutral, href: nil)
  @label = label
  @value = value
  @tone = tone
  @href = href
end