New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

syntax-highlight-component

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syntax-highlight-component

A syntax highlighting component built with Lit for use in web applications. Supports native css syntax highlighting.

latest
Source
npmnpm
Version
1.3.3
Version published
Weekly downloads
8
700%
Maintainers
1
Weekly downloads
 
Created
Source

Syntax Highlighting Component

NPM Version

Syntax Highlighting Component is a customizable web component that makes your code snippets look beautiful and readable! 🚀

  • Built with Lit for fast and lightweight performance ⚡
  • Uses Prism.js for accurate and colorful syntax highlighting 🎨
  • Easy to use: just drop the component into your HTML and specify the language 📝
  • Perfect for documentation, blogs, and developer portfolios 📚

Give your code blocks a professional touch with minimal effort! 💡

Note: This component uses the native HighlightRegistry and ::highlight selector. Check documentation for browser support.

Example

Open in repo Open in StackBlitz

Usage

To use the component, import it in your HTML file and use the <syntax-highlight-component> tag:

<syntax-highlight-component language="css" theme="pink">
  background: linear-gradient(135deg, #9d39e5, #dc454b, #ff1493);
  background-clip: text;
</syntax-highlight-component>

The default theme is light to set other themes use theme attribute and simply pass one one following values: light | dark | pink.

Supported Languages

The language attribute supports the following values:

  • markup
  • css
  • html
  • javascript
  • typescript
  • python
  • ruby
  • plaintext
  • tsx
  • jsx
  • csharp
  • cpp
  • git
  • go
  • java
  • json
  • md
  • php

code highlight example

Keywords

syntax-highlighting

FAQs

Package last updated on 05 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts