N
neokit

Mockup Code

A terminal / code block mockup with gutter prefix labels. Wraps a <div class="mockup-code">. Each line is a <pre data-prefix="..."><code> element.

Single command

Use data-prefix="$" on a <pre> to show a shell prompt.

Shell command
npm install daisyui

Multi-line with output

Mix prompt lines and numbered output lines. Use any string as data-prefix.

Command with output
git status
On branch main
nothing to commit, working tree clean

Highlighted line

Add class="bg-warning text-warning-content" (or any bg/text pair) to a <pre> to highlight that line.

Warning line highlighted
import {neokit} from '@ppreeper/neokit'
// deprecated API call below
neokit.oldMethod()

Error line

Use class="bg-error text-error-content" for error output.

Error output
npm run build
Error: Cannot find module './missing'

Without prefix

Omit data-prefix to show no gutter label on that line.

No prefix
const greeting = "Hello, world!"
console.log(greeting)

Custom background

Pass a bg utility via classes to change the terminal color scheme.

Primary-colored terminal
echo "styled terminal"
styled terminal