TidalUI

Markdown editor preview

Edit controlled Markdown source and inspect a safe local preview.

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/markdown-editor

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

Preview

Markdown editor component preview

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

Required label value accepted by this exported component.

TidalMarkdownEditor.mode (required)
TidalMarkdownEditorMode

Required mode value accepted by this exported component.

TidalMarkdownEditor.onModeChange (required)
(mode: TidalMarkdownEditorMode, event: ReactMouseEvent<HTMLButtonElement>) => void

Callback invoked when the mode change interaction is proposed.

TidalMarkdownEditor.onValueChange (required)
(value: string, event: ChangeEvent<HTMLTextAreaElement> | ReactMouseEvent<HTMLButtonElement>) => void

Callback invoked when the value change interaction is proposed.

TidalMarkdownEditor.value (required)
string

Required value value accepted by this exported component.

TidalMarkdownEditor.description
string | undefined

Optional description value accepted by this exported component.

TidalMarkdownEditor.dir
"ltr" | "rtl" | undefined

Optional dir value accepted by this exported component.

TidalMarkdownEditor.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalMarkdownEditor.error
string | undefined

Optional error value accepted by this exported component.

TidalMarkdownEditor.formatButtonProps
Partial<Record<TidalMarkdownFormat, EditorButtonProps>> | undefined

Optional format button props value accepted by this exported component.

TidalMarkdownEditor.formatButtonRefs
Partial<Record<TidalMarkdownFormat, Ref<HTMLButtonElement>>> | undefined

Optional format button refs value accepted by this exported component.

TidalMarkdownEditor.labels
TidalMarkdownEditorLabels | undefined

Optional labels value accepted by this exported component.

TidalMarkdownEditor.modeButtonProps
Partial<Record<TidalMarkdownEditorMode, ModeButtonProps>> | undefined

Optional mode button props value accepted by this exported component.

TidalMarkdownEditor.modeButtonRefs
Partial<Record<TidalMarkdownEditorMode, Ref<HTMLButtonElement>>> | undefined

Optional mode button refs value accepted by this exported component.

TidalMarkdownEditor.previewHeadingLevel
2 | 3 | 4 | undefined

Optional preview heading level value accepted by this exported component.

TidalMarkdownEditor.previewProps
Omit<HTMLAttributes<HTMLDivElement>, "id" | "role" | "aria-disabled" | "aria-label" | "children" | "dangerouslySetInnerHTML"> | undefined

Optional preview props value accepted by this exported component.

TidalMarkdownEditor.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalMarkdownEditor.textareaProps
EditorTextareaProps | undefined

Optional textarea props value accepted by this exported component.

TidalMarkdownEditor.textareaRef
Ref<HTMLTextAreaElement> | undefined

Optional textarea ref value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas