Diff View

button.tsx
export function Button({ label }) {
return <button>{label}</button>;
return <button className="btn">{label}</button>;
}
About this piece

Diff View

Unified diff with tinted add and remove rows, line numbers, and +/− prefix column.

Usage

The import and the props worth knowing about, in one place.

import { Editor4 } from "@/components/beste/piece/editor4";

<Editor4
  surface="card"
  bordered={true}
  inverted={false}
  filename="button.tsx"
  lines={[
    {
      "kind": "context",
      "line": 12,
      "content": "export function Button({ label }) {"
    },
    {
      "kind": "remove",
      "line": 13,
      "content": "  return <button>{label}</button>;"
    },
    {
      "kind": "add",
      "content": "  return <button className=\"btn\">{label}</button>;"
    },
    {
      "kind": "context",
      "line": 14,
      "content": "}"
    }
  ]}
/>

More Editor pieces

View all Editor
3 cursors
const name = 'Ayşe';
const role = 'design';
const team = 'core';

Multi Cursor

Stacked code lines each with a primary-tinted blinking caret at the same column plus a header count.

1function·greet(name)·{
2return·`Hello,·${name}!`;
3}

Whitespace Markers

Code lines with muted middle-dots for spaces and → glyphs for tabs, revealing indentation.

--primary: #f43f5e;
--accent: #8b5cf6;
--surface: #0ea5e9;

Color Preview

CSS lines with inline color swatch squares next to each hex value.

/\b\w+@\w+\.com\b/gi
12

Regex Input

Regex input with slashes, violet flags, and a tabular match-count pill on the right.

for (let $1:i = 0; $1 < $2:arr.length; $1++) {}
Tab throughTab

Snippet Placeholders

Code template with dashed-outline tab stops. Active placeholder tints primary, others stay muted.

Ship production-ready components in a weekend.
27 chars·3 words

Selection Counter

Text with a primary-tinted highlight and a floating dark pill showing character and word counts.