Navigation/DSPagination
DSPagination
navigationPage 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
| Prop | Type | Default | Description |
|---|---|---|---|
| currentPagereq | Binding<Int> | — | Zero-based current page index. |
| totalPagesreq | Int | — | Total number of pages. |
| style | DSPaginationStyle | .numbers | .numbers (1 2 3) or .dots (● ○ ○). |
| onChange | ((Int) -> Void)? | nil | Called when page changes. |
Examples
Table pagination
Pagination controls below a data table.
swift
DSPagination(
currentPage: $viewModel.currentPage,
totalPages: viewModel.totalPages,
onChange: { viewModel.loadPage($0) }
)