Logo

API

All three adapters share the same presentation options. React passes Markdown as children, Vue as markdown, and the DOM adapter as the first argument to update().

Shared options

OptionTypeDefaultDescription
receivingbooleanfalseWhether this snapshot may still grow. See Streaming a response.
mode"streaming" | "static""streaming"Pace a live answer, or render completed Markdown immediately.
reveal"character" | "word""character"How flowing text enters. See Reveal and timing.
intervalnumber3Base cadence between presentation units, in milliseconds.
durationnumber1000Entrance duration in milliseconds for text and related motion.
reducedMotion"system" | "always" | "never""system"Reduced-motion policy. Independent of mode.
unstyledbooleanfalseDrop the default prose theme. Functional reveal CSS stays.
codeHighlighterCodeHighlighterOptional highlighter from @smoothstream/code.

Adapter surfaces

Import { Smoothstream } from @smoothstream/react.

PropTypeDescription
childrenstringAccumulated Markdown. Must be a string (or an array of strings).
classNamestringClass names on the Markdown root.

Changing interval, duration, mode, or reveal remounts playback. Changing the Markdown to a string that is not a prefix of the current source throws; remount with a new key.

Import { Smoothstream } from @smoothstream/vue.

PropTypeDefaultDescription
markdownstring""Accumulated Markdown.
classstringFallthrough attribute merged onto the Markdown root.

In templates, use kebab-case for multi-word props (:code-highlighter, :reduced-motion). Changing interval, duration, mode, or reveal rebuilds the session. A non-prefix markdown update throws; give the next answer a new key.

Import { createSmoothstream } from @smoothstream/dom.

const stream = createSmoothstream(container, options);stream.update(markdown, { receiving });stream.destroy();stream.element; // HTMLDivElement
NameDescription
options.classNameClass names on the Markdown root. Constructor-only.
update(markdown, { receiving? })Queue the latest append-only snapshot. receiving is the only option that updates after create.
destroy()Tear down the root, listeners, pending work, and announcer.
elementThe managed root inside the container you passed.

mode, reveal, interval, duration, reducedMotion, unstyled, className, and codeHighlighter are constructor-only. A non-prefix update() throws.

Exported TypeScript names: SmoothstreamProps (React, Vue), SmoothstreamOptions, SmoothstreamUpdateOptions, and SmoothstreamController (DOM), plus SmoothstreamMode, SmoothstreamReducedMotion, and SmoothstreamReveal.

createCodeHighlighter

Import { codeHighlighter, createCodeHighlighter } from @smoothstream/code. codeHighlighter is createCodeHighlighter() with defaults.

OptionTypeDefaultDescription
themebundled Shiki theme name"github-light"Single theme. Mutually exclusive with themes.
themes{ light, dark }Paired bundled themes. Mutually exclusive with theme.
defaultColor"light" | "dark" | "light-dark()" | false"light"Shiki’s multiple-theme color strategy. Only with themes.
showLanguageLabelsbooleantrueLanguage name above each fenced block.

Pass the returned highlighter as codeHighlighter to any adapter. See Syntax highlighting.

© 2026 Smoothstream. All rights reserved.

Built with Radiant Docs