SwiftUI text effects
Headlines that reveal word by word, Liquid Glass drawn on real glyph outlines, and paragraphs that clamp to a line limit with a real Read more.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Text is where an app's tone shows first, and it is also where SwiftUI leaves the most to you. Text Reveal staggers a headline in by characters, words or lines from a baseline mask, then wipes highlight blocks behind the phrases that matter. Glass Text renders iOS 26 Liquid Glass on the actual glyph outlines, with a Material fallback below iOS 26 and a solid fill under Reduce Transparency.
Expandable Text solves the everyday problem: it measures whether a paragraph is really truncated before it shows a more link, grows to full height without reflow, and VoiceOver always reads the whole text.
Learn the technique: SwiftUI animations guide, Liquid Glass guide.
Questions
How the pieces work, and how to build the same thing yourself. Every piece's page has its full notes.
How do I animate text in SwiftUI?
For numbers, contentTransition(.numericText()) animates digit changes. For headlines, split the string into words or characters and animate each with a staggered delay, masking each line so glyphs rise from a baseline. Text Reveal packages that, with a stagger sized to land in under a second.
How do I add a Read more button to Text in SwiftUI?
Measure the text at its line limit and at full height, and only show the link when the two differ. Expandable Text does that measurement, fades the end of the last line into the link and animates the height change.
Keep browsing
Nearby collections, then every category in the library.
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- Liquid GlassCorrect iOS 26 Liquid Glass with Material fallbacks.3
- AIStreaming replies, thinking states, prompt chips and code.6
- BackgroundsQuiet atmospheres: a Metal silk shader and a touch-reactive dot grid.2
- Buttons and controlsButtons and dials with press depth, hold, drag and outcome states.5
- Inputs and formsTracks, steppers, rails and fields built for the thumb.9
- CardsCards with depth, motion, parallax and gesture-driven stacks.4
- ListsRows and carousels with swipe, depth and completion physics.5
- NavigationFloating docks, tracking tabs and stretchy headers.3
- SheetsToasts, confirmations and permission moments.3
- FeedbackReactions, ratings, status morphs, skeletons and outcomes.5
- MotionGesture modifiers with real physics.1
- Data and chartsScrubbable charts, rings, live stats and odometers.4
- MediaPhoto viewing and story playback.2
- HapticsPieces that tick, tap and confirm at the moment that matters.19
Ready to build something better?
55 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.