Socket
Book a DemoInstallSign in
Socket

vue-hi-code

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-hi-code

A simple and customizable code highlighter component for Vue 3 to showcase javascript snippets.

latest
Source
npmnpm
Version
1.5.4
Version published
Maintainers
1
Created
Source

vue-hi-code

npm License GitHub issues npm

A light Vue 3 component to display javascript snippets.

npm i vue-hi-code

image

import { VueHiCode } from "vue-hi-code";
import "vue-hi-code/style.css"; // Include the css

const content = `
cosnt foo = function(param) {
    return param + 1;
}
`;
<VueHiCode :content="content" language="javascript" />

Props

NameTypeRequiredDefault
backgroundColorstringno"#2A2A2A"
baseTextColorstringno"#CCCCCC"
borderRadiusstringno"0.3rem"
colorBracketsstringno"#559AD3"
colorCommentstringno"#8A8A8A"
colorCssSelectorstringno"#D7BA7D"
colorCurlyBracketsstringno"#8A8A8A"
colorErrorstringno"#E46962"
colorFunctionstringno"#DCDCAA"
colorHtmlTagstringno"#559AD3"
colorJsReservedstringno"#4ec9b0"
colorKeywordsstringno"#B37BAE"
colorLineNumberstringno"#8A8A8A"
colorNumberstringno"#AEC6A1"
colorParenthesisstringno"#8A8A8A"
colorStringstringno"#CD9077"
colorVariableKeywordstringno"#559AD3"
colorSpecialstringno"#559AD3"
contentstringyes
copyIconColorstringno"#CCCCCC"
copyIconSizenumberno20
copyIconStrokeWidthnumberno1.5
fontFamilystringno"'Fira code', monospace"
fontSizestringno"1rem"
language"javascript" or "html" or "css"yes
lineHeightstringno"1.4rem"
paddingstringno"1rem"
showIconbooleannofalse
titlestringno""
tsTypesCustomstring[]no[]
withCopybooleannotrue
withLineNumbersbooleannofalse

Emits

Using the props withCopy, a button is displayed on the top right of the component, which will copy the text content on click, and emit "copy" with the content.

<VueHiCode :content="content" language="javascript" @copy="copy" />

Keywords

code

FAQs

Package last updated on 02 Nov 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