Markdown editor preview
Edit controlled Markdown source and inspect a safe local preview.
pro · Forms · composite
When to use
- Use it when a page needs edit controlled markdown source and inspect a safe local preview.
- 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 markdown editor.
Configure components.json and the @tidal-pro namespace before installing Pro components.
Installation
npx shadcn@latest add @tidal-pro/markdown-editorImport components/ui/tidal.css, components/ui/markdown-editor.css. Wrap installed components in tidal-scope.
Preview

Minimal example
import"./components/ui/tidal.css";
import"./components/ui/markdown-editor.css";
import{TidalMarkdownEditor}from"./components/ui/markdown-editor";
export default()=><div className="tidal-scope"><TidalMarkdownEditor label={"Demo"} mode={"split"} onModeChange={() => {}} onValueChange={() => {}} value={"value"}/></div>;API and props
TidalMarkdownEditor.label (required)stringRequired label value accepted by this exported component.
TidalMarkdownEditor.mode (required)TidalMarkdownEditorModeRequired mode value accepted by this exported component.
TidalMarkdownEditor.onModeChange (required)(mode: TidalMarkdownEditorMode, event: ReactMouseEvent<HTMLButtonElement>) => voidCallback invoked when the mode change interaction is proposed.
TidalMarkdownEditor.onValueChange (required)(value: string, event: ChangeEvent<HTMLTextAreaElement> | ReactMouseEvent<HTMLButtonElement>) => voidCallback invoked when the value change interaction is proposed.
TidalMarkdownEditor.value (required)stringRequired value value accepted by this exported component.
TidalMarkdownEditor.descriptionstring | undefinedOptional description value accepted by this exported component.
TidalMarkdownEditor.dir"ltr" | "rtl" | undefinedOptional dir value accepted by this exported component.
TidalMarkdownEditor.disabledboolean | undefinedOptional disabled value accepted by this exported component.
TidalMarkdownEditor.errorstring | undefinedOptional error value accepted by this exported component.
TidalMarkdownEditor.formatButtonPropsPartial<Record<TidalMarkdownFormat, EditorButtonProps>> | undefinedOptional format button props value accepted by this exported component.
TidalMarkdownEditor.formatButtonRefsPartial<Record<TidalMarkdownFormat, Ref<HTMLButtonElement>>> | undefinedOptional format button refs value accepted by this exported component.
TidalMarkdownEditor.labelsTidalMarkdownEditorLabels | undefinedOptional labels value accepted by this exported component.
TidalMarkdownEditor.modeButtonPropsPartial<Record<TidalMarkdownEditorMode, ModeButtonProps>> | undefinedOptional mode button props value accepted by this exported component.
TidalMarkdownEditor.modeButtonRefsPartial<Record<TidalMarkdownEditorMode, Ref<HTMLButtonElement>>> | undefinedOptional mode button refs value accepted by this exported component.
TidalMarkdownEditor.previewHeadingLevel2 | 3 | 4 | undefinedOptional preview heading level value accepted by this exported component.
TidalMarkdownEditor.previewPropsOmit<HTMLAttributes<HTMLDivElement>, "id" | "role" | "aria-disabled" | "aria-label" | "children" | "dangerouslySetInnerHTML"> | undefinedOptional preview props value accepted by this exported component.
TidalMarkdownEditor.readOnlyboolean | undefinedOptional read only value accepted by this exported component.
TidalMarkdownEditor.textareaPropsEditorTextareaProps | undefinedOptional textarea props value accepted by this exported component.
TidalMarkdownEditor.textareaRefRef<HTMLTextAreaElement> | undefinedOptional textarea ref 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.