View Source PetalComponents.Pagination (petal_components v1.9.2)

Pagination is the method of splitting up content into discrete pages. It specifies the total number of pages and inidicates to a user the current page within the context of total pages.

Summary

Functions

In the path param you can specify :page as the place your page number will appear. e.g "/posts/:page" => "/posts/1"

Functions

In the path param you can specify :page as the place your page number will appear. e.g "/posts/:page" => "/posts/1"

Attributes

  • path (:string) - page path. Defaults to "/:page".
  • class (:string) - parent div CSS class. Defaults to "".
  • link_type (:string) - Defaults to "a".
  • event (:boolean) - whether to use phx-click events instead of linking. Enabling this will disable link_type and path. Defaults to false.
  • target (:any) - the LiveView/LiveComponent to send the event to. Example: @myself. Will be ignored if event is not enabled. Defaults to nil.
  • total_pages (:integer) - sets a total page count. Defaults to nil.
  • current_page (:integer) - sets the current page. Defaults to nil.
  • sibling_count (:integer) - sets a sibling count. Defaults to 1.
  • boundary_count (:integer) - sets a boundary count. Defaults to 1.
  • show_boundary_chevrons (:boolean) - whether to show prev & next buttons at boundary pages. Defaults to false.
  • Global attributes are accepted.