components / code-block
code-block.
syntax-highlighted code box with a built-in copy button. monochrome prism theme tuned for a black background.
import { Button } from "@/components/ui/button";// a tiny greetingexport function Hello({ name }: { name: string }) {const greeting = `hi ${name}`;return <Button variant="dashed">{greeting}</Button>;}
installation
bunx @justin06lee/chrome@latest add code-blockprops
| name | type | default | description |
|---|---|---|---|
| code * | string | - | source to render; trailing newline trimmed. |
| language | string | "tsx" | prism language id. |
| copyable | boolean | true | show the top-right copy button. |
| resetMs | number | 2000 | ms before the copy label reverts. |