Generic join-based pagination component — groups buttons with shared borders
(the DaisyUI join pattern).
Example
<.pager>
<:item disabled>«</:item>
<:item active={@page == 1} on_click={JS.push("goto", value: %{page: 1})}>1</:item>
<:item active={@page == 2} on_click={JS.push("goto", value: %{page: 2})}>2</:item>
<:item on_click={JS.push("goto", value: %{page: @page + 1})}>»</:item>
</.pager>
Summary
Functions
Attributes
size(:string) - Size of each page button. Defaults to"md".direction(:string) - Layout direction. Defaults to"horizontal".equal_width(:boolean) - Stretch all items to equal width (useful for Prev/Next two-button layout). Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
item(required) - A single page button or nav link. Accepts attributes:active(:boolean) - Marks this page as current (dark fill).disabled(:boolean) - Grays out and disables the button.on_click(:any) - phx-click event.href(:string) - Renders an <a> tag instead of a button.class(:string)