dr-ui
Components

Themed Syntax Highlighter

Read-only syntax-highlighted text themed via design tokens, with search match highlighting and safe URL linkification

Installation

npx shadcn@latest add @dr-ui/themed-syntax-highlighter

Registry dependencies

@dr-ui/utils

Dependencies

react-syntax-highlighter@^16.1.1
@types/react-syntax-highlighter@^15.5.13

Basic

The built-in log grammar with token colors from the active theme and url tokens rendered as links.

Custom language

Register a custom Prism grammar with registerSyntaxHighlighterLanguage and pass it via the language prop.

Search highlight

Search matches are wrapped in mark elements, including matches spanning token boundaries. Pass the query already normalized (trimmed and lowercased).