Class: LoaderComponent

Inherits:
Component show all
Defined in:
app/components/loader_component.rb

Overview

Loader — loading spinners.

Usage:

Loader(active: true)
Loader(active: true, size: :large) { text "Loading..." }
Loader(inline: true, centered: true, active: true)

Constant Summary

Constants inherited from Component

Component::HTML_OPTIONS

Instance Method Summary collapse

Methods inherited from Component

default, #initialize, #render_in, slot

Constructor Details

This class inherits a constructor from Component

Instance Method Details

#to_sObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/loader_component.rb', line 20

def to_s
  classes = class_names(
    "ui",
    size,
    color,
    { "active" => active, "disabled" => disabled, "inline" => inline,
      "centered" => centered, "inverted" => inverted,
      "indeterminate" => indeterminate, "text" => @content.present? },
    "loader"
  )

  tag.div(class: classes) { @content }
end