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(:any) - parent div CSS class. Defaults tonil.variant(:string) - numbered renders the windowed page list; simple renders Previous/Next outline buttons only - fewer decisions on short lists, and the honest form when a total is unreliable. Defaults to"numbered". Must be one of"numbered", or"simple".previous_label(:string) - the previous button's label - visible in the simple variant, announced in the numbered one. Defaults to"Previous".next_label(:string) - the next button's label - visible in the simple variant, announced in the numbered one. Defaults to"Next".aria_label(:string) - names the navigation landmark, localizable. Defaults to"Pagination".link_type(:string) - Defaults to"a". Must be one of"a","live_patch","live_redirect", or"button".event(:any) - usephx-clickevents instead of linking (disableslink_typeandpath).truefires the classic "goto-page" event; a STRING fires that event name instead - how the data table routes page changes through its single on_change grammar.Defaults to
false.target(:any) - the LiveView/LiveComponent to send the event to. Example:@myself. Will be ignored ifeventis not enabled. Defaults tonil.total_pages(:integer) - sets a total page count. Defaults tonil.current_page(:integer) - sets the current page. Defaults tonil.sibling_count(:integer) - sets a sibling count. Defaults to1.boundary_count(:integer) - sets a boundary count. Defaults to1.show_boundary_chevrons(:boolean) - whether to show prev & next buttons at boundary pages. Defaults tofalse.event_values(:map) - extra phx-value-* pairs sent with event-mode clicks, e.g. %{"op" => "page"}. Defaults to%{}.Global attributes are accepted.