Docs
Text

Read-Along TextNew

Text that follows a recording word by word on an even red pill that glides along, read words turning solid; tap to seek.

$npx swiftpieces add ReadAlongText
Free · MIT + Commons ClauseiOS 17.0+karaoketranscriptaudiopodcasthighlightreadingaccessibility
Type
ReadAlongText
Files
ReadAlongText.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

Colors and type for ReadAlongText. .standard is the house palette.

Notes

  • Give it the transcript as words with their start times and durations, from your speech or captions data, and your player's current time. ReadAlongText.Word.spread(_:over:) times plain text across a duration when you have no word timings.
  • The spoken word sits on an even red pill: the word's own box with the same padding on both sides, a little taller than its letters, so it never clips a letter or meets the next word. The pill glides from word to word and from line to line.
  • Words already read turn solid and words to come stay quiet, so the place in the text reads at a glance.
  • Pass onSeek and a tap on any word calls it with that word's start time; leave it out and the text is not tappable.
  • Words wrap like text and the pill, spacing and line gap scale with Dynamic Type.
  • VoiceOver reads the whole passage as one element.
  • Under Reduce Motion the pill moves without overshoot.

Usage

ReadAlongTextExample()

Install

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

Terminal

$npx swiftpieces add ReadAlongText

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

>Add the SwiftPieces "Read-Along Text" 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 text →

Build it yourself: SwiftUI animations guide · Liquid Glass 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.

Explore Pro