HighlightAuto Component

HighlightAuto automatically detects the programming language of the provided code using Highlight.js and applies syntax highlighting. Optionally, it can display a language tag overlay showing the detected language.

Examples

HTML

CSS

Javascript

You can use vite's `import.meta.glob()`:

Markdown

Typescript

Python

Rust

Props

Language Tag: Caution - This may not be accurate.

Set langtag to true to display the language name in the top right corner of the code block.

Language tag style

Customize the language tag background, color, and border-radius using style props.