- Code, Mermaid, and Math components are now opt-in - they are no longer bundled by default
- Import heavy components separately and pass them via the
componentsprop:<script> import { Streamdown } from 'svelte-streamdown'; import Code from 'svelte-streamdown/code'; import Mermaid from 'svelte-streamdown/mermaid'; import Math from 'svelte-streamdown/math'; </script> <Streamdown content={markdown} components={{ code: Code, mermaid: Mermaid, math: Math }} />
- If components are not provided, lightweight fallbacks are used (plain
<pre><code>for code, raw text for math)
- Migrated to
shiki/corefor optimal bundle size - only explicitly imported languages and themes are bundled shikiThemeprop type changed: Now acceptsstringinstead ofBundledThemetype// Before <Streamdown shikiTheme="github-light" /> // ✅ Still works // Type changed from BundledTheme to string
- Removed
shikiPreloadThemesprop: No longer needed as default themes are loaded immediately shikiThemesprop changed: Now acceptsRecord<string, ThemeRegistration>instead ofThemeInfo[]<script> import { Streamdown } from 'svelte-streamdown'; import nord from '@shikijs/themes/nord'; // Pass pre-imported theme objects const customThemes = { 'nord': nord }; </script> <Streamdown content={markdown} shikiThemes={customThemes} shikiTheme="nord" />
- Trimmed default syntax highlighting languages from ~240 to ~28 most commonly used languages
- Unsupported languages now render as plaintext instead of falling back to bash
- Migrated to
shiki/core- dramatically reduced bundle size by only bundling explicitly imported languages and themes
github-darkgithub-light
Web:
javascript (js), typescript (ts), html, css, json, jsx, tsx, markdown (md), yaml (yml), xml, svelte, vue
Backend:
python (py), java, go, rust (rs), ruby (rb), php, c, cpp (c++), csharp (c#, cs), sql, swift, kotlin (kt, kts)
Config/Shell:
shellscript (bash, sh, shell, zsh), docker (dockerfile), toml, graphql (gql)
- Added
shikiLanguagesprop to add extra syntax highlighting languages (merged with defaults) - Added
shikiThemesprop to add extra themes as pre-imported objects - Exported
bundledLanguagesInfo,createLanguageSet, andLanguageInfotype
<script>
import { Streamdown, type LanguageInfo } from 'svelte-streamdown';
// Add extra languages - automatically merged with defaults
const extraLanguages: LanguageInfo[] = [
{
id: 'haskell',
aliases: ['hs'],
import: () => import('@shikijs/langs/haskell')
}
];
</script>
<Streamdown content={markdown} shikiLanguages={extraLanguages} />Import themes from @shikijs/themes and pass them as a record:
<script>
import { Streamdown } from 'svelte-streamdown';
import nord from '@shikijs/themes/nord';
import draculaSoft from '@shikijs/themes/dracula-soft';
// Add custom themes
const customThemes = {
'nord': nord,
'dracula-soft': draculaSoft
};
</script>
<!-- Use a specific custom theme -->
<Streamdown content={markdown} shikiThemes={customThemes} shikiTheme="nord" />When using custom themes, you need to handle the dark/light switching yourself:
<script>
import { Streamdown } from 'svelte-streamdown';
import tokyoNight from '@shikijs/themes/tokyo-night';
import catppuccinLatte from '@shikijs/themes/catppuccin-latte';
const customThemes = {
'tokyo-night': tokyoNight,
'catppuccin-latte': catppuccinLatte
};
// Your app's dark mode state
let isDark = $state(false);
</script>
<!-- Switch theme based on your dark mode state -->
<Streamdown
content={markdown}
shikiThemes={customThemes}
shikiTheme={isDark ? 'tokyo-night' : 'catppuccin-latte'}
/>- New download button for Mermaid diagrams - export diagrams as PNG or SVG
- PNG export renders at 2x scale for high-quality images with white background
- SVG export preserves vector format with proper XML namespaces
- Download button appears in the Mermaid controls bar alongside zoom/fullscreen controls
- Code blocks and Mermaid diagrams now automatically switch themes based on your app's dark/light mode
- Detects theme via
dark/lightclass,data-themeattribute, orcolor-schemestyle on<html>or<body> - Code highlighting automatically switches between
github-darkandgithub-lightthemes - Mermaid diagrams automatically switch between
darkanddefaultthemes - Zero configuration needed for dark mode support - just works with your existing theme setup
<!-- Your app's theme toggle automatically updates code highlighting -->
<html class="dark">
<!-- or data-theme="dark" -->
<!-- or style="color-scheme: dark;" -->- Added
staticprop for rendering pre-processed markdown (e.g., blog posts) without runtime parsing
<Streamdown content={htmlContent} static />parseIncompleteMarkdown- Parse incomplete/streaming markdownIncompleteMarkdownParser- Parser class for streaming scenariosPlugintype - For creating custom parser plugins