Component libraryCode editor

Code editor

Pro

Edit short code or configuration with logical line context and linked diagnostics.

npx shadcn@latest add @tidal-pro/code-editor
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/code-editor

Import components/ui/tidal.css, components/ui/code-editor.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Required nonblank label, controlled value:string and onValueChange(value,event). The component renders one native textarea with direct textareaProps/textareaRef support for name/form/required/placeholder/rows/autocomplete and safe native attributes. Native input and change handlers run before the controlled proposal; prevention from either event suppresses it. disabled and readOnly map to the native textarea and defensively block escaped change proposals; disabled also sets the owned root aria-disabled state and makes the consumer action slot inert. showLineNumbers defaults true and displays logical line numbers when wrap is false; wrap defaults false for local long-line scrolling. tabBehavior defaults 'focus', preserving ordinary Tab navigation. Opt-in 'indent' handles unmodified Tab/Shift+Tab after caller-first keydown and IME/229 guards, proposes exact source, and restores the native selection only after synchronous acceptance while the textarea or body still owns focus. indentation accepts one to eight spaces or tab characters and defaults to two spaces. Consumer-supplied diagnostics require unique nonblank IDs, positive integer line/optional column, nonblank messages and error/warning/info severity; the exact localized list is linked to the textarea and only error severity sets aria-invalid. Optional filename, language, description, actions slot, localized labels, maxHeight 160–720, native root attrs/ref, numeric values within React content, 180px/320px containment, RTL, forced colors and reduced motion are supported. Owned controlled value, replacement markup, textarea role, availability and caller-supplied root aria-disabled channels are type-excluded and runtime-stripped. The editor does not highlight, parse, validate, execute, copy, upload, request, store or persist source.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.