Skip to content
Agentic UI Kit
Buy

Editor Code Codemirror

Light code editor with a language switcher for TypeScript, JSON, CSS, Markdown and Python.

Full screen Try a theme

Choose the primitives library your project already uses. Both look the same: your theme, not the variant, controls colors, shape, type and motion.

About this block

What it's for

  • Light code editor with a language switcher for TypeScript, JSON, CSS, Markdown and Python.
  • CodeMirror 6 editor in React with read-only mode and a diff gutter showing changed lines.
  • Inline editor for config files, snippets or prompts with syntax highlighting that follows the theme.

For a read-only side by side diff between two files, use Code Diff Viewer. For showing code on a marketing page without editing, use Marketing Code Showcase. For rich text with formatting, use Editor Rich Text Tiptap.

Includes

  • Code editing
  • Codemirror
  • Language switch
  • Syntax highlighting
  • Read only mode
  • Diff gutter
  • Line numbers
  • Token theme

Works with

  • Radix UI and Base UI primitives (pick the one your project uses)
  • React 19 and Tailwind CSS 4 in Next.js (App Router), Vite, React Router or TanStack Start, installed with the agentic-ui or shadcn CLI
  • Your theme tokens, in light and dark mode

Install

Included with Agentic UI Kit (one-time license). Install needs your license key: see pricing · connect your project.

Agentic UI CLI
agentic-ui add editor-code-codemirror
Installs through shadcn and adapts the component to your design tokens.
shadcn CLI
npx shadcn@4.17.0 add @agentic-ui/editor-code-codemirror

Used in

A standalone component: drop it into any screen.

Type
Block
Variants
Radix UI and Base UI
Themes
Light and dark
Widths
Preview it at desktop, tablet and mobile widths above.
Sample data
Ships with sample data in code-samples.ts; replace it with your own.