Code Editor Frame

Editor style frame with a monospaced filename tab and a code area. Wrap snippets, editors or diffs so they read as a file in your React docs or app.

src/registry/ui/code-editor-frame.tsx/r/code-editor-frame.json

Installation#

bash
npx shadcn@latest add @minidev/code-editor-frame

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/code-editor-frame.json

Usage#

tsx
import { CodeEditorFrame } from "@/components/ui/code-editor-frame"

export function Example() {
  return (
    <CodeEditorFrame filename="button.tsx">{`export function Button() {\n  return <button />\n}`}</CodeEditorFrame>
  )
}

API reference#

CodeEditorFrame props
PropTypeDefault
filenamestring-
childrenReact.ReactNode-
classNamestring-

Examples#

All Developer tool UI components for React