Class: PhlexKit::CarouselItem

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

Overview

One slide in a PhlexKit::CarouselContent. Full-width/-height by default (basis 100%); override with class: for multi-up layouts. See carousel.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CarouselItem

Returns a new instance of CarouselItem.



5
6
7
# File 'app/components/phlex_kit/carousel/carousel_item.rb', line 5

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

Instance Method Details

#view_templateObject



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

def view_template(&)
  div(**mix({
    role: "group",
    aria: { roledescription: "slide" },
    class: "pk-carousel-item"
  }, @attrs), &)
end