Code editor preview
Edit short code or configuration with logical line context and linked diagnostics.
pro · Forms · composite
When to use
- Use it when a page needs edit short code or configuration with logical line context and linked diagnostics.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.
Alternatives
- Choose form-field instead when a labeled email field with validation and help text is the actual interface need, rather than code editor.
Configure components.json and the @tidal-pro namespace before installing Pro components.
Installation
npx shadcn@latest add @tidal-pro/code-editorImport components/ui/tidal.css, components/ui/code-editor.css. Wrap installed components in tidal-scope.
Preview

Minimal example
import"./components/ui/tidal.css";
import"./components/ui/code-editor.css";
import{TidalCodeEditor}from"./components/ui/code-editor";
export default()=><div className="tidal-scope"><TidalCodeEditor label={"Demo"} onValueChange={() => {}} value={"value"}/></div>;API and props
TidalCodeEditor.label (required)stringRequired label value accepted by this exported component.
TidalCodeEditor.onValueChange (required)(value: string, event: ChangeEvent<HTMLTextAreaElement> | KeyboardEvent<HTMLTextAreaElement>) => voidCallback invoked when the value change interaction is proposed.
TidalCodeEditor.value (required)stringRequired value value accepted by this exported component.
TidalCodeEditor.actionsReactNodeOptional actions value accepted by this exported component.
TidalCodeEditor.descriptionReactNodeOptional description value accepted by this exported component.
TidalCodeEditor.diagnosticsReadonlyArray<TidalCodeEditorDiagnostic> | undefinedOptional diagnostics value accepted by this exported component.
TidalCodeEditor.disabledboolean | undefinedOptional disabled value accepted by this exported component.
TidalCodeEditor.filenamestring | undefinedOptional filename value accepted by this exported component.
TidalCodeEditor.indentationstring | undefinedOptional indentation value accepted by this exported component.
TidalCodeEditor.labelsTidalCodeEditorLabels | undefinedOptional labels value accepted by this exported component.
TidalCodeEditor.languagestring | undefinedOptional language value accepted by this exported component.
TidalCodeEditor.maxHeightnumber | undefinedOptional max height value accepted by this exported component.
TidalCodeEditor.readOnlyboolean | undefinedOptional read only value accepted by this exported component.
TidalCodeEditor.showLineNumbersboolean | undefinedOptional show line numbers value accepted by this exported component.
TidalCodeEditor.tabBehaviorTidalCodeEditorTabBehavior | undefinedOptional tab behavior value accepted by this exported component.
TidalCodeEditor.textareaPropsCodeTextareaProps | undefinedOptional textarea props value accepted by this exported component.
TidalCodeEditor.textareaRefRef<HTMLTextAreaElement> | undefinedOptional textarea ref value accepted by this exported component.
TidalCodeEditor.wrapboolean | undefinedOptional wrap value accepted by this exported component.
Complete usage
Full example, stylesheet imports, API and accessibility documentation
Gotchas
- Keep field state, validation results, submission, and persistence in the host form workflow.