# `PetalComponents.PaginationInternal`
[🔗](https://github.com/petalframework/petal_components/blob/v3.2.0/lib/petal_components/pagination_internal.ex#L1)

# `get_pagination_items`

get_items computes the pagination button information based on
- total number of pages,
- current page,
- sibling count (pages left and right of current page)
- boundary count (pages at start, and at end of the page range)

As this control receives user input, possibly from the internet
a reasonable result is computed despite invalid input values and
at least one page item is returned always.

* The resulting items list always has 1 + max(0, sibling_count) + max(0, boundary_count) page items
* The resulting items may/will contains ellipsis items only if boundary_count > 0
* The previous item has `:enabled?` false if page 1 is current
* The next item has `:enabled?` false if the last page is current

please see the unit tests for examples

---

*Consult [api-reference.md](api-reference.md) for complete listing*
