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

The sample represents the simplest pagination with default controls and page view.

Max pages

The preview limits the number of pages displayed at a time, so you can clearly see the truncation of longer pagination.

Round

The preview changes the shape of the pagination elements to a round variant, which will affect the overall visual character of the navigation.

First, Last Buttons

The demonstration focuses on the button form of pagination, where the actions of the previous and next page dominate.

Show info

The preview adds textual status information to the pagination, such as the current page or range of results.

Responsive layout

When the component is narrower than 768 px (md), it automatically separates the page-size selector and item range into a summary row and places page navigation below it. A CSS container query makes the component respond to its own available width without a responsive attribute or JavaScript.

Spacing and dimensions can be changed with CSS custom properties. Individual elements can be targeted with ::part(), for example wje-pagination::part(page-size-label) or wje-pagination::part(page-button).

When to use

Use wje-pagination for lists and tables whose results are divided into multiple pages. It renders navigation, an optional item range, and an optional page-size selector; loading the data remains the parent application's responsibility.

When not to use

Don't just use it as a visual decorative element without interaction. In this case, give priority to the presentation components.

Accessibility

The component uses a navigation role, named previous and next actions, and aria-current="page" for the active page. When multiple paginations appear on the same screen, give each one a descriptive aria-label.

  • Limit the number of visible page buttons with max-pages for large result sets.
  • Prevent duplicate requests in the parent application while a page is loading.
  • Prefer CSS custom properties and shadow parts when changing the appearance.

Attributes and properties

hideEmpty

PopisUrčuje, či je voľba hide-empty zapnutá a ovplyvňuje správanie komponentu.
Atribúthide-empty
Typboolean
Predvolenéfalse

maxPages

PopisNastavuje číselnú hodnotu používanú vo voľbe max-pages.
Atribútmax-pages
Typnumber|string
Predvolené10

page

PopisNastavuje textovú hodnotu uloženú vo voľbe page.
Atribútpage
Typstring
Predvolené0

pageSize

PopisNastavuje rozmery alebo veľkosť pre voľbu page-size.
Atribútpage-size
Typnumber|string
Predvolené3

pageSizeOptions

PopisNastavuje rozmery alebo veľkosť pre voľbu page-size-options.
Atribútpage-size-options
TypArray<number>
Predvolené-

round

PopisUrčuje, či je voľba round zapnutá a ovplyvňuje správanie komponentu.
Atribútround
Typboolean
Predvolenéfalse

showFirstButton

PopisUrčuje, či je voľba show-first-button zapnutá a ovplyvňuje správanie komponentu.
Atribútshow-first-button
Typboolean
Predvolenéfalse

showInfo

PopisUrčuje, či je voľba show-info zapnutá a ovplyvňuje správanie komponentu.
Atribútshow-info
Typboolean
Predvolenéfalse

showLastButton

PopisUrčuje, či je voľba show-last-button zapnutá a ovplyvňuje správanie komponentu.
Atribútshow-last-button
Typboolean
Predvolenéfalse

showPageSizeOptions

PopisNastavuje rozmery alebo veľkosť pre voľbu show-page-size-options.
Atribútshow-page-size-options
Typboolean
Predvolenéfalse

totalItems

PopisNastavuje číselnú hodnotu používanú vo voľbe total-items.
Atribúttotal-items
Typnumber
Predvolené0

Events

NázovPopis
wje-pagination:page-changeVyvolá sa pri zmene stavu komponentu.

Methods

htmlPagination

PopisVytvorí HTML štruktúru pre html pagination.
Signatúra() => DocumentFragment

htmlStackButtons

PopisVytvorí HTML štruktúru pre html stack buttons.
Signatúra(paginateObj: object) => DocumentFragment

CSS shadow parts

NázovPopis
nativeŠtýluje koreňovú shadow časť komponentu.
summaryŠtýluje shadow časť summary.
page-sizeŠtýluje shadow časť page-size.
page-size-labelŠtýluje shadow časť page-size-label.
page-size-selectŠtýluje shadow časť page-size-select.
infoŠtýluje shadow časť info.
pagesŠtýluje shadow časť pages.
page-buttonŠtýluje shadow časť page-button.
page-numberŠtýluje shadow časť page-number.
current-pageŠtýluje shadow časť current-page.
first-buttonŠtýluje shadow časť first-button.
previous-buttonŠtýluje shadow časť previous-button.
next-buttonŠtýluje shadow časť next-button.
last-buttonŠtýluje shadow časť last-button.
dotsŠtýluje shadow časť dots.

CSS custom variables

NázovPopis
--wje-pagination-gapVlastná CSS premenná, ktorá riadi gap.
--wje-pagination-summary-gapVlastná CSS premenná, ktorá riadi summary gap.
--wje-pagination-page-size-gapVlastná CSS premenná, ktorá riadi page size gap.
--wje-pagination-mobile-gapVlastná CSS premenná, ktorá riadi mobile gap.
--wje-pagination-page-size-widthVlastná CSS premenná, ktorá riadi page size width.
--wje-pagination-page-button-widthVlastná CSS premenná, ktorá riadi page button width.
--wje-pagination-page-button-gapGap between pagination buttons.

Slots

Pre tento komponent nie sú dostupné žiadne sloty.