TidalUI

Code editor preview

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

pro · Forms · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

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

Import components/ui/tidal.css, components/ui/code-editor.css. Wrap installed components in tidal-scope.

Preview

Code editor component preview

Open interactive 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)
string

Required label value accepted by this exported component.

TidalCodeEditor.onValueChange (required)
(value: string, event: ChangeEvent<HTMLTextAreaElement> | KeyboardEvent<HTMLTextAreaElement>) => void

Callback invoked when the value change interaction is proposed.

TidalCodeEditor.value (required)
string

Required value value accepted by this exported component.

TidalCodeEditor.actions
ReactNode

Optional actions value accepted by this exported component.

TidalCodeEditor.description
ReactNode

Optional description value accepted by this exported component.

TidalCodeEditor.diagnostics
ReadonlyArray<TidalCodeEditorDiagnostic> | undefined

Optional diagnostics value accepted by this exported component.

TidalCodeEditor.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalCodeEditor.filename
string | undefined

Optional filename value accepted by this exported component.

TidalCodeEditor.indentation
string | undefined

Optional indentation value accepted by this exported component.

TidalCodeEditor.labels
TidalCodeEditorLabels | undefined

Optional labels value accepted by this exported component.

TidalCodeEditor.language
string | undefined

Optional language value accepted by this exported component.

TidalCodeEditor.maxHeight
number | undefined

Optional max height value accepted by this exported component.

TidalCodeEditor.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalCodeEditor.showLineNumbers
boolean | undefined

Optional show line numbers value accepted by this exported component.

TidalCodeEditor.tabBehavior
TidalCodeEditorTabBehavior | undefined

Optional tab behavior value accepted by this exported component.

TidalCodeEditor.textareaProps
CodeTextareaProps | undefined

Optional textarea props value accepted by this exported component.

TidalCodeEditor.textareaRef
Ref<HTMLTextAreaElement> | undefined

Optional textarea ref value accepted by this exported component.

TidalCodeEditor.wrap
boolean | undefined

Optional wrap value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas