Class: PhlexKit::Popover

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

Overview

Click-triggered floating panel — native [popover] + CSS anchor positioning with viewport-edge flipping (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.



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

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

Instance Method Details

#view_templateObject



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

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