Class: PhlexKit::PaginationNext
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::PaginationNext
- 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
Instance Method Summary collapse
-
#initialize(href: "#", label: "Next", **attrs) ⇒ PaginationNext
constructor
A new instance of PaginationNext.
- #view_template ⇒ Object
Methods inherited from BaseComponent
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_template ⇒ Object
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 |