Class: UI::MenubarLabelComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
MenubarLabelBehavior
Defined in:
app/view_components/ui/menubar_label_component.rb

Overview

LabelComponent - ViewComponent implementation

Non-interactive label for grouping items.

Examples:

Basic usage

render UI::LabelComponent.new { "Theme" }

Instance Method Summary collapse

Methods included from MenubarLabelBehavior

#menubar_label_classes, #menubar_label_data_attributes, #menubar_label_html_attributes

Constructor Details

#initialize(inset: false, classes: "", **attributes) ⇒ MenubarLabelComponent

Returns a new instance of MenubarLabelComponent.



12
13
14
15
16
# File 'app/view_components/ui/menubar_label_component.rb', line 12

def initialize(inset: false, classes: "", **attributes)
  @inset = inset
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



18
19
20
21
22
# File 'app/view_components/ui/menubar_label_component.rb', line 18

def call
   :div, **menubar_label_html_attributes.deep_merge(@attributes) do
    content
  end
end