Skip to main content

Pagination

The Pagination component is used to display pagination in applications. It allows users to navigate between different pages of content, improving the user experience when browsing large amounts of data.

Basic use

Max pages

Round

First, Last Buttons

Show info

When to use

Use wje-pagination when users need to enter values, choose options, or trigger form-related actions.

When not to use

Do not use it as a decorative element without interaction. Prefer presentational components in that case.

Accessibility

Always provide a label (label/aria-label), keep keyboard support, and surface clear validation feedback.

Best Practices

  • Keep validation rules and error behavior consistent across the entire form.
  • Show loading or disabled states during async operations.
  • Split complex forms into smaller sections with immediate feedback.

Attributes and Properties

page

DescriptionRetrieves the current page number as a numeric value.
Attributepage
Typenumber
Default-

totalItems

DescriptionRetrieves the total number of items represented by the 'total-items' attribute.
Attributetotal-items
Typenumber
Default-

pageSize

DescriptionRetrieves the value of the 'page-size' attribute and converts it to a number. If the attribute is not set or is invalid, returns the default value of 3.
Attributepage-size
Typenumber
Default-

Events

NameDescription
wje-pagination:page-changeEmitted when component state changes.

Methods

htmlPagination

DescriptionCreates a pagination control for navigating between pages of content. This method generates and returns a document fragment containing pagination controls, including buttons for navigating to the first, previous, next, and last pages, as well as optional informational text about the current set of displayed items and total number of items.
Signature() => DocumentFragment

htmlStackButtons

DescriptionCreates and returns a DocumentFragment containing a series of buttons for pagination purposes, based on the provided pagination object.
Signature(paginateObj: object) => DocumentFragment

CSS Shadow Parts

NameDescription
nativeThe wrapper element for the pagination component.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

No slots available for this component.