Class: PhlexKit::TooltipTrigger

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

Overview

The element a PhlexKit::Tooltip is anchored to. tabindex: 0 so keyboard users can focus it (the bubble shows on :focus-within). See tooltip.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ TooltipTrigger

Returns a new instance of TooltipTrigger.



5
6
7
# File 'app/components/phlex_kit/tooltip/tooltip_trigger.rb', line 5

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

Instance Method Details

#view_template(&block) ⇒ Object



9
10
11
# File 'app/components/phlex_kit/tooltip/tooltip_trigger.rb', line 9

def view_template(&block)
  span(**mix({ class: "pk-tooltip-trigger", tabindex: 0 }, @attrs), &block)
end