Class: PhlexKit::AttachmentGroup

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

Overview

Horizontally scrollable, snapping row of Attachments with an edge fade (the phlex-kit--scroll-fade controller in horizontal mode). See attachment.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ AttachmentGroup

Returns a new instance of AttachmentGroup.



6
7
8
# File 'app/components/phlex_kit/attachment/attachment_group.rb', line 6

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

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
18
19
# File 'app/components/phlex_kit/attachment/attachment_group.rb', line 10

def view_template(&)
  div(**mix({
    class: "pk-attachment-group",
    role: "group",
    data: {
      controller: "phlex-kit--scroll-fade",
      phlex_kit__scroll_fade_axis_value: "x"
    }
  }, @attrs), &)
end