@streamdown/code

Syntax highlighting for code blocks using Shiki.

The @streamdown/code plugin provides syntax highlighting for code blocks using Shiki.

  • Supports 200+ programming languages
  • Languages are lazy-loaded on demand
  • Dual theme support (light/dark mode)
  • Token caching for performance

Install

npm install @streamdown/code

Usage

import { code } from '@streamdown/code';

<Streamdown plugins={{ code }}>
  {markdown}
</Streamdown>

Custom configuration

import { createCodePlugin } from '@streamdown/code';

const code = createCodePlugin({
  themes: ['github-light', 'github-dark'], // [light, dark]
});

See Code Blocks for details on rendering behavior, line numbers, and copy buttons.

On this page

GitHubEdit this page on GitHub