Class: Shadcn::MenubarCheckboxItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::MenubarCheckboxItemComponent
- Defined in:
- app/components/shadcn/menubar_checkbox_item_component.rb
Overview
Menubar Checkbox Item component A menu item that can be checked/unchecked
Constant Summary collapse
- BASE_CLASSES =
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(checked: false, disabled: false, **options, &block) ⇒ MenubarCheckboxItemComponent
constructor
A new instance of MenubarCheckboxItemComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(checked: false, disabled: false, **options, &block) ⇒ MenubarCheckboxItemComponent
Returns a new instance of MenubarCheckboxItemComponent.
15 16 17 18 19 |
# File 'app/components/shadcn/menubar_checkbox_item_component.rb', line 15 def initialize(checked: false, disabled: false, **, &block) super(**, &block) @checked = checked @disabled = disabled end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'app/components/shadcn/menubar_checkbox_item_component.rb', line 21 def call content_tag(:div, item_content, item_attributes) end |