Class: PhlexKit::Popover

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

Overview

Click-triggered floating panel, positioned with CSS (no @floating-ui). Ported from ruby_ui's RubyUI::Popover. Compose Popover > (PopoverTrigger + PopoverContent). phlex-kit--popover.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ Popover

Returns a new instance of Popover.



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

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

Instance Method Details

#view_templateObject



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

def view_template(&)
  div(**mix({ class: "pk-popover", data: { controller: "phlex-kit--popover" } }, @attrs), &)
end