Skip to content

SyntaxHighlighter

Shiki-backed source-code presenter for Silvery React targets. It renders a plain first frame immediately, then upgrades to structured syntax tokens when the requested grammar is ready.

Import

tsx
import { SyntaxHighlighter } from "silvery"

Props

PropTypeDefaultDescription
languagestringrequiredShiki language name or alias
codestringrequiredSource text
themestring"github-dark"Shiki theme
barebooleanfalseOmit the framed surface and hover label
backgroundColorstringunsetBackground applied to every rendered token
boldbooleanfalseForce bold in addition to token-level styles

Usage

tsx
<SyntaxHighlighter language="typescript" code={source} />

SyntaxHighlighter is for live React targets. For framework-neutral token data, filename inference, or raw one-shot ANSI output, use highlight, languageForPath, or highlightToAnsi from @silvery/syntax.

See Also

  • Text -- styled text primitive
  • CodeBlock -- semantic prose code blocks