Component packs › Mono › 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.
| Prop | Type | Default | Description |
|---|---|---|---|
code | string | ||
lang | MzLang | ||
filename | string | ||
steps | CodeStep[] | ||
label | string | ||
dark | boolean | ||
onStep | (i: number) => void | ||
autoplay | number | false | Showcase mode: moves to the next step every N ms while visible. |
readonly step: numbergo(i: number): voiddestroy(): voidimport CodeBlock from './CodeBlock';
<CodeBlock />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Code blocks.