Installation
Usage
Display code with beautiful syntax highlighting powered by Shiki.Features
Syntax Highlighting
Shiki provides beautiful, accurate syntax highlighting using VS Code’s grammar engine:Line Numbers
Enable line numbers for easier reference:File Names
Show the filename in the header:Language Icons
Icons automatically appear for recognized languages using Devicon:Copy & Download
Built-in copy and download buttons:- Click the copy icon to copy code to clipboard
- Click the download icon to save as a file
- Copy button shows a checkmark on success
Supported Languages
The component supports 40+ languages including:- Web: JavaScript, TypeScript, HTML, CSS, JSX, TSX
- Backend: Python, Java, Go, Rust, PHP, Ruby, C, C++, C#
- Data: JSON, XML, YAML, SQL
- Shell: Bash, Shell
- Other: Markdown, Kotlin, Swift, Dockerfile
Props
Styling
The component uses Shiki’s GitHub themes:- Light mode:
github-light - Dark mode:
github-dark
Accessibility
- Copy and download buttons have proper
aria-labelattributes - Language displayed as text when icon unavailable
- Keyboard accessible controls
- Code content is selectable and copyable
- Pre-formatted text maintains proper semantic structure