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

solid-highlight

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-highlight

Solid component for syntax highlighting, based on react-highlight and highlightjs' vue plugin

Source
npmnpm
Version
0.1.24
Version published
Weekly downloads
2K
-29.96%
Maintainers
1
Weekly downloads
 
Created
Source

solid-highlight

solid-highlight

size size npm pnpm

solid-highlight

Documentation

Installation

npm i solid-highlight
# or
yarn add solid-highlight
# or
pnpm add solid-highlight

Usage

Importing component

import { Highlight } from "solid-highlight";

Adding styles

Choose the theme for syntax highlighting and add corresponding styles of prism.js by importing in your index.tsx file

import "prismjs/themes/prism-okaidia.min.css";

The styles will most likely be in node_modules/prismjs/themes folder.

Adding languages

Choose the languages available for syntax highlighting by importing in your index.tsx file

import "prismjs/components/prism-typescript";

The languages will most likely be in node_modules/prismjs/components folder.

Properties

PropertyTypeDefaultDescription
classstringCustom css classes to be included
languagestringjavascriptLanguage of code to be highlighted

Syntax highlighting of code snippet

Code snippet that requires syntax highlighting should be passed as children to Highlight component in string format.

<Highlight language="javascript">
  {" "}
  {"function foo() { return 'bar' }"}{" "}
</Highlight>

Keywords

solidjs component

FAQs

Package last updated on 24 Feb 2024

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