npm.io
0.1.6 • Published 2d ago

@inkset/code

Licence
MIT
Version
0.1.6
Deps
2
Size
13 kB
Vulns
0
Weekly
0
Stars
6

@inkset/code

Shiki-powered code block plugin for Inkset.

Install

npm install @inkset/code shiki

Usage

import { Inkset } from "@inkset/react";
import { createCodePlugin } from "@inkset/code";

const plugins = [createCodePlugin({ theme: "github-dark" })];

export const Example = ({ content }: { content: string }) => {
  return <Inkset content={content} plugins={plugins} />;
};

Options

  • theme — primary (dark-mode) shiki theme. Default "github-dark".
  • lightTheme — companion theme rendered under @media (prefers-color-scheme: light).
  • showHeader — language label + copy button bar. Default true.
  • showCopy — copy button inside the header. Default true.
  • showLangLabel — language badge on the left of the header. Default true.
  • wrapLongLines — wrap long lines instead of horizontal scrolling. Default false.

See the repo root for the broader Inkset architecture and playground examples.

Keywords