YuhuanStudioYunUIDocs
Patterns

Blog Pagination

A compact controlled page navigator with prev/next and windowed numbered pages.

A compact page navigator for blog listings: previous/next buttons plus a windowed run of numbered pages (with leading/trailing ellipses). It is controlled — the host owns routing through onPageChange.

Import

import { BlogPagination } from "@yuhuanowo/yunui/patterns";

Example

onPageChange is a function, which can't cross the server→client boundary in MDX, so the example is rendered from a small client wrapper that tracks the current page in state.

BlogPagination

...

Props

PropTypeDefaultDescription
currentPage*number
labels{ previous?: string; next?: string; } | undefinedLocalized labels; default to English.
onPageChange*(page: number) => voidNavigate to a page. The host app owns routing / query-string updates.
totalPages*number

On this page