Class: PhlexUI::HoverCard

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/hover_card.rb

Defined Under Namespace

Classes: Content, Trigger

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(option: {}, **attrs) ⇒ HoverCard

Returns a new instance of HoverCard.



5
6
7
8
9
10
# File 'lib/phlex_ui/hover_card.rb', line 5

def initialize(option: {}, **attrs)
  @options = option
  @options[:delay] ||= [500, 250]
  @options[:trigger] ||= "mouseenter focus click"
  super(**attrs)
end

Instance Method Details

#view_templateObject



12
13
14
# File 'lib/phlex_ui/hover_card.rb', line 12

def view_template(&)
  div(**attrs, &)
end