markstream-svelte
Markstream Svelte
- Confirm Svelte 5; ask Svelte 4 users to upgrade.
- Add package and only requested peers.
- Import CSS after resets; KaTeX CSS for math.
- Default to
<MarkdownRender {content} />.- For streaming AI chat, keep
contentand use built-in smooth streaming first.smoothStreaming="auto"is the default and activates whentypewriter={true}ormaxLiveNodes <= 0.typewriteronly controls the blinking cursor and defaults tofalse.fadecontrols node enter and streamed-text fade animations and defaults totrue.
- Streaming vs recovering history: in chat UIs the same renderer starts streaming and later switches to history when
final={true}.- Streaming:
smoothStreaming="auto",fade={false},typewriter={true}. Smooth pacing handles gradual appearance; fade would flicker. - Recovering history:
smoothStreaming={false},fade={true},typewriter={false}. Content is already complete — pacing would slow it down, but fade gives a polished entry animation. - Dynamic switch:
smoothStreaming={isStreaming ? 'auto' : false},fade={!isStreaming}.
- Streaming:
- Use
nodes+finalfor worker-preparsed content, shared AST stores, or custom AST control.
- For streaming AI chat, keep
- Use
$props()and callbacks. - Workers:
setKaTeXWorker,setMermaidWorker,workers/*?worker. - Custom UI: scoped
setCustomComponents,customId,customHtmlTags. - Verify with
svelte-check, build, or e2e.
More from simon-he95/markstream-vue
markstream-vue
Integrate markstream-vue into a Vue 3 app. Use when Codex needs to add the Vue 3 renderer, import CSS in the right order, choose between `content` and `nodes`, enable optional peers like Mermaid, KaTeX, D2, Monaco, or stream-markdown, or wire scoped custom components in a non-Nuxt Vue repository.
96markstream-custom-components
Override built-in Markstream node renderers and add trusted custom tags. Use when Codex needs to apply `setCustomComponents`, keep overrides scoped with `customId`, map override keys like `image`, `code_block`, `mermaid`, or `link`, or wire `customHtmlTags` and nested renderers for tags such as `thinking`.
59markstream-install
Install and wire markstream-vue, markstream-react, markstream-vue2, markstream-angular, or markstream-svelte into an existing repository. Use when Codex needs to choose the right package, install the smallest peer-dependency set, fix CSS/reset order, decide between `content` and `nodes`, or add a minimal working renderer example.
56markstream-migration
Audit and migrate existing Markdown rendering to Markstream. Use when Codex needs to replace another renderer, classify direct vs custom vs plugin-heavy usage, preserve behavior during adoption, migrate custom renderers into scoped Markstream overrides, or decide when `nodes` streaming is worth adopting.
47markstream-nuxt
Integrate markstream-vue into a Nuxt 3 or Nuxt 4 app. Use when Codex needs client-only boundaries, SSR-safe setup, browser-only peer gating, worker-aware initialization, or a safe `MarkdownRender` integration inside pages, components, or Nuxt plugins.
34markstream-react
Integrate markstream-react into a React 18+ or Next app. Use when Codex needs to add the React renderer, import CSS correctly, choose between `content` and `nodes`, keep Next client boundaries safe, convert renderer overrides, or prepare a repo for `react-markdown` migration.
28