Class: PhlexKit::PaginationPrevious
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::PaginationPrevious
- Defined in:
- app/components/phlex_kit/pagination/pagination_previous.rb
Overview
"Previous" control (chevron + label, label hidden on small screens), ported from shadcn/ui's PaginationPrevious. Renders its own
Instance Method Summary collapse
-
#initialize(href: "#", label: "Previous", **attrs) ⇒ PaginationPrevious
constructor
A new instance of PaginationPrevious.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(href: "#", label: "Previous", **attrs) ⇒ PaginationPrevious
Returns a new instance of PaginationPrevious.
6 7 8 9 10 |
# File 'app/components/phlex_kit/pagination/pagination_previous.rb', line 6 def initialize(href: "#", label: "Previous", **attrs) @href = href @label = label @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/components/phlex_kit/pagination/pagination_previous.rb', line 12 def view_template li do a(**mix({ href: @href, class: "pk-button ghost pk-pagination-previous", aria: { label: "Go to previous page" } }, @attrs)) do render Icon.new(:chevron_left, size: nil) span(class: "pk-pagination-label") { @label } end end end |