Skip to content

Improper animation when streaming rich content #437

@cadenmarinozzi

Description

@cadenmarinozzi

Bug Description

When animating streamed markdown content, only the final word at the end of a sentence/chunk is animated, along with some rich content inside (italics, bold, etc), the rest is static. This causes an unsightly and improper display of incoming streamed content, where the animated text seems randomly selected.

Steps to Reproduce

This can be seen in the online playground, and in self hosted platforms using Streamdown. Provided are steps to reproduce on the playground:

  1. Set to 'streaming' mode
  2. Set animated to 'On'
  3. Set to any effect, I am using 'blurIn'
  4. Set to a higher duration to easily visualize the issue (1000ms+).
  5. Clear
  6. Simulate stream

Expected Behavior

Words or characters (depending on animation split setting) should be animated sequentially and in order as they are received, no matter the content type.
The first word should have 0 animation delay, the second should have 1 unit of animation delay, the third should have 2 units of animation delay, and so on.
This is the functionality seen on leading chat AI platforms.

Actual Behavior

When animating streamed markdown content, only the final word at the end of a sentence/chunk is animated, along with some rich content inside (italics, bold, etc), the rest is static. This causes an unsightly and improper display of incoming streamed content, where the animated text seems randomly selected.

Code Sample

import { Streamdown } from "streamdown"

<Streamdown
  animated={{ duration: 300, animation: "blurIn" }}
  isAnimating={isAnimating}
>
  {children}
</Streamdown>

Streamdown Version

2.3.0

React Version

19.2.3

Node.js Version

25.6.1

Browser(s)

No response

Operating System

None

Additional Context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions