Class: Shadcn::DropdownMenuLabelComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::DropdownMenuLabelComponent
- Defined in:
- app/components/shadcn/dropdown_menu_label_component.rb
Overview
Dropdown Menu Label component
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
- #call ⇒ Object
-
#initialize(inset: false, **options, &block) ⇒ DropdownMenuLabelComponent
constructor
A new instance of DropdownMenuLabelComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(inset: false, **options, &block) ⇒ DropdownMenuLabelComponent
Returns a new instance of DropdownMenuLabelComponent.
9 10 11 12 |
# File 'app/components/shadcn/dropdown_menu_label_component.rb', line 9 def initialize(inset: false, **, &block) super(**, &block) @inset = inset end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/shadcn/dropdown_menu_label_component.rb', line 14 def call content_tag(:div, content, class: cn(BASE_CLASSES, @inset ? "pl-8" : "", class_name)) end |