Class: PhlexKit::CarouselContent

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

Overview

The clipping viewport + sliding track holding the CarouselItems. The controller translates the track; orientation styling comes from the parent .pk-carousel's is-horizontal/is-vertical modifier. See carousel.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CarouselContent

Returns a new instance of CarouselContent.



6
7
8
# File 'app/components/phlex_kit/carousel/carousel_content.rb', line 6

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

Instance Method Details

#view_templateObject



10
11
12
13
14
# File 'app/components/phlex_kit/carousel/carousel_content.rb', line 10

def view_template(&)
  div(class: "pk-carousel-viewport", data: { phlex_kit__carousel_target: "viewport" }) do
    div(**mix({ class: "pk-carousel-track" }, @attrs), &)
  end
end