Class: ContainerComponent

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

Overview

Container — fixed-width page container.

Usage:

Container { text "Page content" }
Container(text: true) { text "Narrower text container" }
Container(fluid: true) { text "Full-width" }

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



14
15
16
17
18
19
20
21
22
# File 'app/components/container_component.rb', line 14

def to_s
  classes = class_names(
    "ui",
    { "text" => text, "fluid" => fluid },
    "container"
  )

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