Skip to main content

    AiResponse

    Use the AiResponse component to animate AI-generated content.

    Import

    import { AiResponse } from '@dynatrace/strato-components/content';

    Use cases

    CodeSandbox

    Response state

    The responseState prop controls how the component renders and animates content:

    • streaming (default): Use while the AI response is actively being generated. The component animates each new word as it arrives, giving users a live typing effect.
    • complete: Set this once streaming has finished and the full response text has been passed. The component finishes animating any remaining words that have not yet been displayed.
    • static: Use when the full response is available upfront and no animation is needed. The content is rendered immediately without any animation.
    CodeSandbox

    Animation state

    The onAnimationStateChange callback lets you react to the word-by-word animation. It is called with true when the animation starts and with false once the last word of the current content has fully faded in.

    Still have questions?
    Find answers in the Dynatrace Community