Component packs › Mono › Code Block

Code Block

Step through a file: the highlight band slides down to each step's lines and stretches to fit them while the note changes underneath.

Code Block is a code walkthrough from Mono, a component pack with 6 code components: Code UI where changes move: diffs slide lines in and out, and the terminal runs its script. Price: $2 for the whole pack.

Built with: sliding line band, own highlighter, copy.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Code Block props

PropTypeDefaultDescription
codestring
langMzLang
filenamestring
stepsCodeStep[]
labelstring
darkboolean
onStep(i: number) => void
autoplaynumber | falseShowcase mode: moves to the next step every N ms while visible.

Methods on the ref

Use it in React

import CodeBlock from './CodeBlock';

<CodeBlock />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Mono

Good for: Code blocks.