Skip to content

Pagination ​

Pagination with page navigation, next and previous links. The page window comes from the pure function sparkPaginationRange(page, total, siblings) (-1 = ellipsis).

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Controlled ​

Bind the 1-based page with !!.

Approximate web preview — the HarmonyOS rendering is the reference.

Responsive ​

Measures its own width: when narrower than 480vp the labels collapse to icons and siblingCount drops to 0.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SPagination ​

shadcn-vue Pagination (rendered as one component): Previous, page links, ellipses and Next. Page links use the button recipe (ghost, active page outline, icon size).

Responsive without breakpoints: when the pagination itself is narrower than 480vp the Previous / Next labels collapse to icons and siblingCount drops to 0. The page window comes from {@link sparkPaginationRange}.

PropTypeDefaultDescription
page!!number | undefinedundefinedControlled current page, 1-based (use with !!). Leave undefined for uncontrolled.
defaultPagenumber1
totalnumber1Number of pages.
siblingCountnumber1Pages shown on each side of the current page (wide layout).
previousTextResourceStr$r('app.string.spark_previous')
nextTextResourceStr$r('app.string.spark_next')
EventTypeDefaultDescription
onPageChange(page: number) => void() => { }

MIT Licensed