Theme-adaptive editor window with traffic-light header, filename, and a tokenized code body.
export function greet(name: string) {return `Hello, ${name}!`;}// Ship it
Requires shadcn/ui initialized. Run npx shadcn@latest init if you haven't.
import { Editor1 } from "@/components/beste/piece/editor1";
<Editor1
filename="greet.ts"
lines={[
{
"tokens": [
{
"text": "export",
"kind": "keyword"
},
{
"text": " "
},
{
"text": "function",
"kind": "keyword"
},
{
"text": " "
},
{
"text": "greet",
"kind": "fn"
},
{
"text": "(name: string) {"
}
]
},
{
"tokens": [
{
"text": " "
},
{
"text": "return",
"kind": "keyword"
},
{
"text": " "
},
{
"text": "`Hello, ${name}!`",
"kind": "string"
},
{
"text": ";"
}
]
},
{
"tokens": [
{
"text": "}"
}
]
},
{
"tokens": []
},
{
"tokens": [
{
"text": "// Ship it",
"kind": "comment"
}
]
}
]}
/>Settings card with a segmented light / dark / system toggle and icon plus label per option.
Nested file explorer with folder chevrons, amber folder icons, and a highlighted active file.
Code template with dashed-outline tab stops. Active placeholder tints primary, others stay muted.
1// TODO migrate to server components2// FIXME handles null state poorly3// NOTE revisit once design lock lands
Italic comment lines with colored TODO, FIXME, NOTE, or HACK tags.
Command palette card with a search bar, ranked results, hint captions, and kbd shortcut pills.
1function·greet(name)·{2→return·`Hello,·${name}!`;3}
Code lines with muted middle-dots for spaces and → glyphs for tabs, revealing indentation.