Class: PhlexKit::PaginationNext

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

Overview

"Next" control (label + chevron, label hidden on small screens), ported from shadcn/ui's PaginationNext. Renders its own

  • . See pagination.rb.

  • Instance Method Summary collapse

    Methods inherited from BaseComponent

    #on

    Constructor Details

    #initialize(href: "#", label: "Next", **attrs) ⇒ PaginationNext

    Returns a new instance of PaginationNext.

    
    
    5
    6
    7
    8
    9
    # File 'app/components/phlex_kit/pagination/pagination_next.rb', line 5
    
    def initialize(href: "#", label: "Next", **attrs)
      @href = href
      @label = label
      @attrs = attrs
    end

    Instance Method Details

    #view_templateObject

    
    
    11
    12
    13
    14
    15
    16
    17
    18
    # File 'app/components/phlex_kit/pagination/pagination_next.rb', line 11
    
    def view_template
      li do
        a(**mix({ href: @href, class: "pk-button ghost pk-pagination-next", aria: { label: "Go to next page" } }, @attrs)) do
          span(class: "pk-pagination-label") { @label }
          render Icon.new(:chevron_right, size: nil)
        end
      end
    end