structyl

Code Block

stable

A presentational code block with an optional filename header, line numbers, and a built-in copy button.

Basic usage

example.ts
const sum = (a: number, b: number) => a + b;console.log(sum(2, 3));

Features

  • Optional filename / language header.
  • Toggleable line-number gutter.
  • Built-in copy-to-clipboard button.
  • Line highlighting via highlightLines.

Installation

bash
pnpm dlx structyl add code-block

API Reference

Code Block API reference

Full props, types, defaults.

View API
Code Block | structyl