npm / react-shiki
react-shiki
What changed in react-shiki 0.11, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.
2 breaking5 new APIs and options2 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-shiki 0.1113 changes
Breaking changes 2
The language label no longer has the hardcoded
language-labelID, avoiding duplicate IDs when pages render multiple code blocks; use.rs-language-labelor[data-slot="language-label"]for styling.Default styles are now unlayered with zero-specificity :where() selectors. Cascade-layer overrides for pre padding or border-radius no longer apply when applyDefaultStyles is enabled; plain unlayered CSS is unaffected.
New APIs and options 5
Accepts
'javascript'or'oniguruma'alongside engine instances; named engines are created, cached, and lazy-loaded internally, and'javascript'skips the WASM fetch.Adds an option to highlight specific lines by displayed line number, respecting startingLineNumber. Highlighted lines receive the rs-highlighted-line class.
Adds a CSS variable for the highlighted-line background color, defaulting to the theme text color at 10% opacity.
Adds a CSS variable for line-number color on highlighted lines, defaulting to the theme text color at 65% opacity.
Adds experimental
outputFormat: 'tokens'support to the hook, returning Shiki's raw TokensResult for custom rendering. The return type narrows based on the literal outputFormat passed.
Behavior and default changes 2
The
pre, language label, and highlighted line selectors are fully wrapped in:where(), giving them zero specificity so user rules always win.Accepts dynamic grammar imports on the full and web bundles, allowing custom grammars to stay code-split instead of shipping in the main bundle.
Fixes and other changes 4
Fixes throttle state typing for React 18.
Language alias matching is now case-insensitive.
Styles are embedded in the JS and install automatically at runtime, so no CSS import or bundler configuration is needed;
react-shiki/cssremains available for build-time CSS pipelines.Language ids are trimmed before resolving.