Skip to main content
.contentTransition(type: ContentTransitionType | { countsDown: boolean })
type
ContentTransitionType | { countsDown: boolean }
required
The content transition type. Can be:
  • "numericText" — animates numeric text changes with a rolling digit effect
  • "opacity" — cross-fades between old and new content
  • "identity" — no animation, content updates immediately
  • "interpolate" — smoothly interpolates between old and new content
  • { countsDown: boolean } — numeric text transition with direction hint (true for counting down, false for counting up)

Support

Usage

Animate a numeric counter

Text(String(count))
    .contentTransition("numericText")

Numeric text with direction hint

Text(String(countdown))
    .contentTransition({ countsDown: true })

Cross-fade content changes

Text(statusMessage)
    .contentTransition("opacity")

See Also