PrismJS

standalone
plugin
svelte

A simple Svelte plugin built with TypeScript to display code inside the browser, using PrismJS .

Install

#

PrismJS is required as a peer dependency so you can use the themes and languages provided.

Basic Usage

#

The plugin exposes attributes to provide the source and the language. Attributes to display line numbers and a copy button are also available.

Install languages

#

PrismJS supports a ton of languages out of the box. You can use any of these languages simply by importing the syntax highlighting. Languages install themselves automatically, but PrismJS must be imported first.

Themes

#

You can modify Prism code sections style simply by importing a stylesheet. PrismJS provides many themes out of the box that you can easily import. Otherwise, there is a wide variety of themes available on the web and even a theme generator .