Class: PhlexKit::CarouselNext

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

Overview

Next-slide button — the CarouselPrevious counterpart on the trailing edge. See carousel.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CarouselNext

Returns a new instance of CarouselNext.



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

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

Instance Method Details

#view_templateObject



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

def view_template
  render Button.new(variant: :outline, icon: true, disabled: true, **mix({
    class: "pk-carousel-next",
    data: { action: "click->phlex-kit--carousel#scrollNext", phlex_kit__carousel_target: "nextButton" }
  }, @attrs)) do
    icon
    span(class: "pk-sr-only") { "Next slide" }
  end
end