Class: PhlexKit::DropdownMenuSub

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/dropdown_menu/dropdown_menu_sub.rb

Overview

Nested submenu wrapper: SubTrigger row + SubContent panel, revealed on hover/focus with pure CSS (no extra controller). Ported from shadcn/ui's DropdownMenuSub. See dropdown_menu.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ DropdownMenuSub

Returns a new instance of DropdownMenuSub.



6
# File 'app/components/phlex_kit/dropdown_menu/dropdown_menu_sub.rb', line 6

def initialize(**attrs) = (@attrs = attrs)

Instance Method Details

#view_templateObject



7
8
9
# File 'app/components/phlex_kit/dropdown_menu/dropdown_menu_sub.rb', line 7

def view_template(&)
  div(**mix({ class: "pk-dropdown-menu-sub" }, @attrs), &)
end