react-shiki
Version:
Syntax highlighter component for react using shiki
26 lines (23 loc) • 1.35 kB
TypeScript
import { S as ShikiHighlighterProps, U as UseShikiHighlighter } from './component-B4tYZaD8.js';
export { E as Element, H as HighlighterOptions, L as Language, T as Theme, a as Themes, i as isInlineCode, r as rehypeInlineCodeProperty } from './component-B4tYZaD8.js';
import 'shiki';
import 'react';
import 'shiki/core';
import 'hast';
/**
* A React hook that provides syntax highlighting using Shiki with the full bundle.
* Includes all languages and themes for maximum compatibility.
*
* Bundle size: ~6.4MB minified (1.2MB gzipped)
*
* For smaller bundles, consider:
* - `react-shiki/web` for smaller shiki web bundle (~3.8MB minified, 695KB gzipped)
* - `react-shiki/core` for custom fine-grained bundle
*/
declare const useShikiHighlighter: UseShikiHighlighter;
/**
* ShikiHighlighter component using the full bundle.
* Includes all languages and themes for maximum compatibility.
*/
declare const ShikiHighlighter: ({ language, theme, delay, transformers, defaultColor, cssVariablePrefix, addDefaultStyles, style, langStyle, className, langClassName, showLanguage, showLineNumbers, startingLineNumber, children: code, as: Element, customLanguages, ...shikiOptions }: ShikiHighlighterProps) => React.ReactElement;
export { ShikiHighlighter, ShikiHighlighterProps, UseShikiHighlighter, ShikiHighlighter as default, useShikiHighlighter };