Class: SegmentComponent

Inherits:
Component show all
Includes:
Attachable, Sizeable
Defined in:
app/components/segment_component.rb

Overview

Segment — grouped content sections.

Usage:

Segment { text "Basic segment" }
Segment(raised: true, padded: :very) { text "Raised" }
Segment(inverted: true, color: :blue) { text "Blue inverted" }

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



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/components/segment_component.rb', line 31

def to_s
  classes = class_names(
    "ui",
    size,
    color,
    padded && "#{padded == "very" ? "very " : ""}padded",
    { "attached" => attached,
      "raised" => raised,
      "stacked" => stacked,
      "piled" => piled,
      "vertical" => vertical,
      "inverted" => inverted,
      "compact" => compact,
      "loading" => loading,
      "clearing" => clearing,
      "basic" => basic,
      "circular" => circular,
      "disabled" => disabled,
      "placeholder" => placeholder_seg,
      "secondary" => secondary,
      "tertiary" => tertiary },
    "segment"
  )

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