Class: Ui::Tooltip::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/uikit_rails/templates/components/tooltip/component.rb

Overview

Hover/focus tooltip popup.

Constant Summary collapse

POSITIONS =
%i[top bottom left right].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, position: :top, **html_attrs) ⇒ Component

Returns a new instance of Component.



11
12
13
14
15
16
# File 'lib/uikit_rails/templates/components/tooltip/component.rb', line 11

def initialize(text:, position: :top, **html_attrs)
  @text = text
  @position = position.to_sym
  @html_attrs = html_attrs
  super()
end

Instance Attribute Details

#html_attrsObject (readonly)

Returns the value of attribute html_attrs.



9
10
11
# File 'lib/uikit_rails/templates/components/tooltip/component.rb', line 9

def html_attrs
  @html_attrs
end

#positionObject (readonly)

Returns the value of attribute position.



9
10
11
# File 'lib/uikit_rails/templates/components/tooltip/component.rb', line 9

def position
  @position
end

#textObject (readonly)

Returns the value of attribute text.



9
10
11
# File 'lib/uikit_rails/templates/components/tooltip/component.rb', line 9

def text
  @text
end