| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
React component for code syntax highlighting. Preview 📕
Why another code syntax highlighting package?
npm install code-colors-reactimport { ColorTokens } from "code-colors-react";
<pre>
<ColorTokens code={"console.log('hello world');"} lang={"js"} />
</pre>;To style the highlighted code, you can use any of the pre-defined themes from Prism.
You can do it in JavaScript like so:
import { loadCss } from "thingies/lib/loadCss";
const theme = "github";
const url = `https://cdn.jsdelivr.net/npm/prism-themes@1.9.0/themes/${theme}.min.css`;
loadCss(url);Basic JavaScript:
Negative values with red background:
Nested languages: JavaScript and CSS inside HTML:
| Back | FazBrowse Home | New Git URL |