Class: UI::PaginationLink

Inherits:
Phlex::HTML
  • Object
show all
Includes:
PaginationLinkBehavior
Defined in:
app/components/ui/pagination_link.rb

Overview

Pagination Link component (Phlex) Clickable link for page numbers

Instance Method Summary collapse

Methods included from PaginationLinkBehavior

#link_base_classes, #link_classes, #link_html_attributes, #link_size_classes, #link_variant_classes

Constructor Details

#initialize(href: "#", active: false, size: "icon", classes: "", attributes: {}) ⇒ PaginationLink

Returns a new instance of PaginationLink.

Parameters:

  • href (String) (defaults to: "#")

    URL for the link

  • active (Boolean) (defaults to: false)

    whether this link is for the current page

  • size (String) (defaults to: "icon")

    size variant: “icon”, “default”, “sm”, “lg”

  • classes (String) (defaults to: "")

    additional CSS classes

  • attributes (Hash) (defaults to: {})

    additional HTML attributes



13
14
15
16
17
18
19
20
# File 'app/components/ui/pagination_link.rb', line 13

def initialize(href: "#", active: false, size: "icon", classes: "", attributes: {}, **)
  @href = href
  @active = active
  @size = size
  @classes = classes
  @attributes = attributes
  super()
end

Instance Method Details

#view_template(&block) ⇒ Object



22
23
24
# File 'app/components/ui/pagination_link.rb', line 22

def view_template(&block)
  a(**link_html_attributes, &block)
end