Class: Shadcn::CommandGroupComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::CommandGroupComponent
- Defined in:
- app/components/shadcn/command_group_component.rb
Overview
Command Group component - groups related command items
Constant Summary collapse
- BASE_CLASSES =
"overflow-hidden p-1 text-foreground"- HEADING_CLASSES =
"px-2 py-1.5 text-xs font-medium text-muted-foreground"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(heading: nil, **options) ⇒ CommandGroupComponent
constructor
A new instance of CommandGroupComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(heading: nil, **options) ⇒ CommandGroupComponent
Returns a new instance of CommandGroupComponent.
15 16 17 18 |
# File 'app/components/shadcn/command_group_component.rb', line 15 def initialize(heading: nil, **) super(**) @heading = heading end |
Instance Method Details
#call ⇒ Object
20 21 22 |
# File 'app/components/shadcn/command_group_component.rb', line 20 def call content_tag(:div, group_content, class: merge_classes(BASE_CLASSES), role: "group", data: { "shadcn--command-target": "group" }, **.merge(build_data)) end |