Class: PhlexKit::MessageScroller

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

Overview

Height-constrained chat transcript with autoscroll/anchoring. Ported from ruby_ui's RubyUI::MessageScroller. Mark the scroll viewport, content list, and jump button inside with data-phlex-kit--message-scroller-target attributes.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ MessageScroller

Returns a new instance of MessageScroller.



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

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

Instance Method Details

#view_templateObject



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

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