Class: Flowbite::Pagination
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Flowbite::Pagination
- Defined in:
- app/components/flowbite/pagination.rb,
app/components/flowbite/pagination/gap.rb,
app/components/flowbite/pagination/link.rb,
app/components/flowbite/pagination/next_link.rb,
app/components/flowbite/pagination/previous_link.rb,
app/components/flowbite/pagination/chevron_left_icon.rb,
app/components/flowbite/pagination/chevron_right_icon.rb
Overview
Renders pagination controls for navigating between pages of results.
This component doesn't know about pages, page numbers, or any pagination
library. The caller decides which pages to show (including where to
place gaps) using the pages slot, and provides the URLs for the
previous/next links directly.
Defined Under Namespace
Classes: ChevronLeftIcon, ChevronRightIcon, Gap, Link, NextLink, PreviousLink
Instance Attribute Summary collapse
-
#next_url ⇒ Object
readonly
Returns the value of attribute next_url.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#previous_url ⇒ Object
readonly
Returns the value of attribute previous_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(next_url: nil, previous_url: nil, class: nil, **options) ⇒ Pagination
constructor
A new instance of Pagination.
Constructor Details
#initialize(next_url: nil, previous_url: nil, class: nil, **options) ⇒ Pagination
Returns a new instance of Pagination.
50 51 52 53 54 55 |
# File 'app/components/flowbite/pagination.rb', line 50 def initialize(next_url: nil, previous_url: nil, class: nil, **) @next_url = next_url @previous_url = previous_url @class = Array.wrap(binding.local_variable_get(:class)) @options = end |
Instance Attribute Details
#next_url ⇒ Object (readonly)
Returns the value of attribute next_url.
42 43 44 |
# File 'app/components/flowbite/pagination.rb', line 42 def next_url @next_url end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
42 43 44 |
# File 'app/components/flowbite/pagination.rb', line 42 def @options end |
#previous_url ⇒ Object (readonly)
Returns the value of attribute previous_url.
42 43 44 |
# File 'app/components/flowbite/pagination.rb', line 42 def previous_url @previous_url end |
Class Method Details
.classes ⇒ Object
37 38 39 |
# File 'app/components/flowbite/pagination.rb', line 37 def classes ["flex", "-space-x-px", "text-sm"] end |