Native SwiftUI animation for streaming LLM output. No dependencies.
Add FlowToken to your Swift package:
.package(url: "https://github.com/undivisible/flowtoken-swift.git", from: "0.1.0")Then add "FlowToken" to the target dependencies.
Use TokenizedText for plain streamed output. The view preserves whitespace, wraps at its container width, and animates only newly appended tokens.
import FlowToken
import SwiftUI
struct ReplyView: View {
let reply: String
var body: some View {
TokenizedText(reply, separator: .word, animation: .blurIn)
}
}separator accepts .diff (the default, one animation per streamed chunk), .word, and .character.
Use AnimatedMarkdown when SwiftUI's native Markdown rendering is more important than per-token animation:
AnimatedMarkdown("## Hello, **world**!", animation: .fadeIn)TokenizedText(_:separator:animation:animationDuration:)AnimatedMarkdown(_:animation:animationDuration:)FlowTokenSeparator:.diff,.word,.characterFlowTokenAnimation:.fadeIn,.blurIn,.dropIn,.slideUp,.scaleIn,.none
swift testISC