🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vue-hljs

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

vue-hljs

Highlight.js plugin for Vue.js 3.0

3.0.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

npm package build status

vue-hljs

Overview

ℹ️ Update: Highlight.js has released an official vue plugin since Mar 23, 2021. See highlightjs/vue-plugin.

This is a vue plugin which allows you to highlight code blocks via vue-directive.

Install

npm install vue-hljs highlight.js

or

yarn add vue-hljs highlight.js

Example

import { createApp } from 'vue'
import vueHljs from "vue-hljs";
import hljs from "highlight.js";
//if you want to use default color, import this css file
import "vue-hljs/style.css";

const app = createApp({})
app.use(vueHljs, { hljs })
<div v-highlight>
  <pre>
    <!-- you can specify language by modifing the class attribute -->
    <code class="typescript">...</code>
  </pre>
</div>

Use your own style

This plugin use gruvbox-dark as default style.

You can write your own style or see highlight.js demo. And then import your css file in Vue project entry.

Other similar projects

  • highlightjs/vue-plugin: Highlight.js official plugin.

Keywords

highlight

FAQs

Package last updated on 05 Jun 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