Skip to content
Viewership Inquire
UI Components

Stream Text.

Text that streams in like model output, with a blurred edge and caret.

FeedbackAtomNo dependencies Beautiful UI, MIT

.md

Weekly report

Northwind Outdoor · Week 41 · GA4

Organic sessions rose 12% week over week, led by the trail pack guide. Paid search held a 4.1x ROAS on flat spend. Perplexity now cites the guide on 3 of 5 tracked prompts. Move $800 from display to search next week.

Using Claude Code? Give it the agent prompt and skip these steps.

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy the 2 files

    Paste into src/components/viewership/stream-text/

  3. Use it

    Page.astro
    ---
    import StreamText from "../components/viewership/stream-text/StreamText.astro";
    ---
    
    <StreamText />

Props 11

PropTypeDefaultDescription
text string · The text to stream.
charsPerTick number 2 Characters per tick. Higher is faster.
tickMs number 9 Tick interval, ms.
blurTail number 6 Trailing characters that are blurred.
caret boolean true Show the caret. Blinks once idle.
autoplay boolean true Stream when in view. If false, wait for vs-stream-play.
loop boolean false Replay after loopDelay.
loopDelay number 2400 Pause before replay, ms.
reserveSpace boolean false Reserve final size to prevent layout shift. Block contexts only.
events vs-stream-play · vs-stream-progress · vs-stream-done · Dispatch vs-stream-play ({ text? }) to restart. Listen for progress ({ count }) and done.
streamText(el, text, opts) (el: HTMLElement, text: string, opts?: StreamTextOptions) => StreamTextHandle · Stream into any element from your own script. Handle: pause, resume, finish, stop.

Source 2 files

Ported from Beautiful UI, MIT. Notices.

Used by Selection Actions