Docs
Navigation

Page DotsNew

A page control whose red capsule pours from dot to dot, with tap and scrub to jump and an autoplay timer that fills the capsule.

$npx swiftpieces add PageDots
Free · MIT + Commons ClauseiOS 17.0+Liquid Glasspaginationpage-controlcarouselautoplayhaptics
Type
PageDots
Files
PageDots.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

Colors and size for PageDots. .standard is the house palette: a red current page among quiet dots.

Notes

  • Bind page to the same index as your TabView or paging ScrollView. The dots follow it, and a tap or a scrub writes it back.
  • The current page is a red capsule. On a change the new dot stretches open on a tight spring and the old one closes on a looser one a beat later, so the red pours from one to the other instead of jumping.
  • Tap a dot to jump to it, or drag along the row to scrub through the pages with a selection tick for each one you cross. The whole row is a 44pt touch target.
  • autoplay turns the page after the given time and wraps from the last page to the first. The capsule fills from its leading end as a timer, restarts when the page changes, and pauses while a finger is on the dots.
  • glass: true sets the dots on a liquid glass capsule, for dots over photos or busy content.
  • VoiceOver reads the row as one adjustable element, "Page 2 of 5": swipe up or down to change the page. .disabled(true) dims the dots and ignores touches.
  • Under Reduce Motion the capsule swaps on one short spring without the pour. The autoplay timer still fills, since it carries meaning. Reduce Transparency draws the glass capsule as a solid shape.

Usage

PageDotsExample()

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add PageDots

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Page Dots" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All navigation →

Build it yourself: SwiftUI animations guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro