Class: Shadcn::MenubarLabelComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/shadcn/menubar_label_component.rb

Overview

Menubar Label component Label for grouping menu items

Constant Summary collapse

BASE_CLASSES =
"px-2 py-1.5 text-sm font-semibold"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Instance Method Summary collapse

Methods inherited from BaseComponent

#content

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

#initialize(inset: false, **options, &block) ⇒ MenubarLabelComponent

Returns a new instance of MenubarLabelComponent.

Parameters:

  • inset (Boolean) (defaults to: false)

    Whether to add left padding



10
11
12
13
# File 'app/components/shadcn/menubar_label_component.rb', line 10

def initialize(inset: false, **options, &block)
  super(**options, &block)
  @inset = inset
end

Instance Method Details

#callObject



15
16
17
# File 'app/components/shadcn/menubar_label_component.rb', line 15

def call
  (:div, content, label_attributes)
end