Class: Shadcn::DropdownMenuCheckboxItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::DropdownMenuCheckboxItemComponent
- Defined in:
- app/components/shadcn/dropdown_menu_checkbox_item_component.rb
Overview
Dropdown Menu 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 transition-colors hover:bg-accent hover:text-accent-foreground 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) ⇒ DropdownMenuCheckboxItemComponent
constructor
A new instance of DropdownMenuCheckboxItemComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(checked: false, disabled: false, **options, &block) ⇒ DropdownMenuCheckboxItemComponent
Returns a new instance of DropdownMenuCheckboxItemComponent.
15 16 17 18 19 |
# File 'app/components/shadcn/dropdown_menu_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/dropdown_menu_checkbox_item_component.rb', line 21 def call content_tag(:div, item_content, item_attributes) end |