Class: Shadcn::SelectGroupComponent

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

Overview

Select Group component

Constant Summary collapse

LABEL_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(label: nil, **options, &block) ⇒ SelectGroupComponent

Returns a new instance of SelectGroupComponent.

Parameters:

  • label (String, nil) (defaults to: nil)

    Group label



13
14
15
16
# File 'app/components/shadcn/select_group_component.rb', line 13

def initialize(label: nil, **options, &block)
  super(**options, &block)
  @label = label
end

Instance Method Details

#callObject



18
19
20
# File 'app/components/shadcn/select_group_component.rb', line 18

def call
  (:div, group_content, role: "group")
end