Class: PhlexKit::PaginationLink
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::PaginationLink
- Defined in:
- app/components/phlex_kit/pagination/pagination_link.rb
Overview
A page-number link (square ghost button; outline when active), ported from shadcn/ui's PaginationLink. Renders its own
Instance Method Summary collapse
-
#initialize(href: "#", active: false, **attrs) ⇒ PaginationLink
constructor
A new instance of PaginationLink.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(href: "#", active: false, **attrs) ⇒ PaginationLink
Returns a new instance of PaginationLink.
5 6 7 8 9 |
# File 'app/components/phlex_kit/pagination/pagination_link.rb', line 5 def initialize(href: "#", active: false, **attrs) @href = href @active = active @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/components/phlex_kit/pagination/pagination_link.rb', line 11 def view_template(&block) li do a(**mix({ href: @href, class: "pk-button #{@active ? "outline" : "ghost"} icon", aria: { current: (@active ? "page" : nil) } }, @attrs), &block) end end |