Class: PhlexKit::PaginationItem

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

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(href: "#", active: false, **attrs) ⇒ PaginationItem

Returns a new instance of PaginationItem.



3
4
5
6
7
# File 'app/components/phlex_kit/pagination/pagination_item.rb', line 3

def initialize(href: "#", active: false, **attrs)
  @href = href
  @active = active
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



8
9
10
11
12
# File 'app/components/phlex_kit/pagination/pagination_item.rb', line 8

def view_template(&block)
  li do
    a(**mix({ href: @href, class: "pk-button #{@active ? "outline" : "ghost"}", aria: { current: (@active ? "page" : nil) } }, @attrs), &block)
  end
end