Class: ButtonGroupComponent

Inherits:
Component show all
Includes:
Sizeable
Defined in:
app/components/button_group_component.rb

Overview

ButtonGroup — a group of buttons displayed together.

Usage:

ButtonGroup(color: "teal") {
  Button { "Save" }
  Dropdown(floating: true, button: true) { ... }
}
ButtonGroup(icon: true) {
  Button { Icon(name: "bold") }
  Button { Icon(name: "italic") }
}

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



24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/components/button_group_component.rb', line 24

def to_s
  classes = class_names(
    "ui",
    color,
    size,
    { "icon" => icon, "vertical" => vertical, "basic" => basic,
      "labeled" => labeled },
    "buttons"
  )

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