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.
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) }
)