Navigation/DSPagination

DSPagination

navigation
since v2.0

Page control with previous/next buttons and numbered page indicators. Supports compact (dots) and full (numbers) modes.

iOS 17+macOS 14+

Purpose

Tabular data pagination, photo galleries, and onboarding carousels.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
currentPagereqBinding<Int>Zero-based current page index.
totalPagesreqIntTotal number of pages.
styleDSPaginationStyle.numbers.numbers (1 2 3) or .dots (● ○ ○).
onChange((Int) -> Void)?nilCalled when page changes.

Examples

Table pagination

Pagination controls below a data table.

swift
DSPagination(
    currentPage: $viewModel.currentPage,
    totalPages: viewModel.totalPages,
    onChange: { viewModel.loadPage($0) }
)

Related Components