LiveFilter.Paginator (LiveFilter v0.3.0)

Copy Markdown View Source

LiveComponent that renders pagination controls.

Provides:

  • Page info text ("Showing 26 to 50 of 127 results"; "No results"; or, when the offset is past the last row, "No results on this page" with a button back to page 1)
  • Per-page selector dropdown
  • Prev/Next buttons
  • Configurable page number stepper

Notifies the parent via {:livefilter, :page_changed, params} when pagination changes.

Example

<.live_component
  module={LiveFilter.Paginator}
  id="pagination"
  pagination={@pagination}
  max_pages={5}
/>

Or using the convenience function:

<LiveFilter.paginator pagination={@pagination} max_pages={5} />