Class: PhlexKit::PaginationItem
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::PaginationItem
- Defined in:
- app/components/phlex_kit/pagination/pagination_item.rb
Instance Method Summary collapse
-
#initialize(href: "#", active: false, **attrs) ⇒ PaginationItem
constructor
A new instance of PaginationItem.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
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 |