Skip to content
Nana UI

Pagination

View .md Download

A navigation control for paged data. It lives beside a table or list, never inside it. Controlled-by-attribute but self-updating: clicking moves the page (updating page) and emits nana-page-change so consumers can slice (client-side) or refetch (server-side).

Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/pagination";
<nana-pagination page="1" total-pages="10"></nana-pagination>

The layout attribute switches between numbered (default), compact, and simple.

Properties

PropertyAttributeTypeDefaultDescription
boundaryCountboundary-countnumber1Page numbers pinned at each end
disabledbooleanfalseDisable the whole control (e.g. while loading)
layoutPaginationLayout'numbered'Structural layout
pagenumber1Current page (1-based)
pageSizepage-sizenumber10Rows per page
pageSizeOptionspage-size-optionsstring'10,25,50,100'Comma-separated page-size options
showFirstLastshow-first-lastbooleanfalseShow « First / Last » buttons
showJumpshow-jumpbooleanfalseShow the jump-to-page input
showPageSizeshow-page-sizebooleanfalseShow the rows-per-page selector
showResultCountshow-result-countbooleanfalseShow the "Showing X–Y of Z" summary
siblingCountsibling-countnumber1Page numbers shown either side of the current page
sizePaginationSize'md'Control size
totalItemstotal-itemsnumber | undefinedTotal number of items — derives total pages and the result count
totalPagestotal-pagesnumber | undefinedExplicit total pages (used when totalItems is unknown)
variantPaginationVariant'default'Visual style

Events

EventDescription
nana-page-changedetail: { page }
nana-page-size-changedetail: { pageSize }

CSS parts

PartDescription
::part(nav)The controls container
::part(ellipsis)The truncation gap (…)

CSS custom properties

PropertyDescription
--nana-pagination-radiusCorner radius of the page controls
--nana-pagination-active-bgActive page background (filled / pill)
--nana-pagination-active-colorActive page text colour (filled / pill)
EventTypeDescription
nana-page-changeCustomEventdetail: { page }
nana-page-size-changeCustomEventdetail: { pageSize }
VariableDefaultDescription
--nana-pagination-radiusCorner radius of the page controls
--nana-pagination-active-bgActive page background (filled / pill)
--nana-pagination-active-colorActive page text colour (filled / pill)
PartDescription
navThe controls container — every page-number and navigation button
ellipsisThe truncation gap () between page runs
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Pagination interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook