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.

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