Skip to content

Vizel API / react/src / VizelProps

Interface: VizelProps

Defined in: packages/react/src/components/Vizel.tsx:22

Properties

autofocus?

ts
optional autofocus?: number | boolean | "all" | "start" | "end";

Defined in: packages/react/src/components/Vizel.tsx:45

Auto focus on mount


bubbleMenuContent?

ts
optional bubbleMenuContent?: (props) => ReactNode;

Defined in: packages/react/src/components/Vizel.tsx:79

Custom bubble menu content as a render prop. Receives the bound editor instance so the consumer can drive Tiptap commands from custom controls. Mirrors the Vue <slot name="bubble-menu" :editor> and the Svelte bubbleMenu: Snippet<[{ editor }]>.

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

ReactNode


children?

ts
optional children?: ReactNode;

Defined in: packages/react/src/components/Vizel.tsx:81

Additional children to render inside the editor root


className?

ts
optional className?: string;

Defined in: packages/react/src/components/Vizel.tsx:59

Custom class name for the editor container


editable?

ts
optional editable?: boolean;

Defined in: packages/react/src/components/Vizel.tsx:43

Whether the editor is editable (default: true)


enableEmbed?

ts
optional enableEmbed?: boolean;

Defined in: packages/react/src/components/Vizel.tsx:72

Enable embed option in bubble menu link editor (requires Embed extension)


extensions?

ts
optional extensions?: Extensions;

Defined in: packages/react/src/components/Vizel.tsx:57

Additional Tiptap extensions


features?

ts
optional features?: VizelFeatureOptions;

Defined in: packages/react/src/components/Vizel.tsx:47

Feature configuration


flavor?

ts
optional flavor?: VizelMarkdownFlavor;

Defined in: packages/react/src/components/Vizel.tsx:53

Markdown output flavor. Controls how Markdown is serialized when exporting content.

Default

ts
"gfm"

initialContent?

ts
optional initialContent?: JSONContent;

Defined in: packages/react/src/components/Vizel.tsx:24

Initial content in JSON format


initialMarkdown?

ts
optional initialMarkdown?: string;

Defined in: packages/react/src/components/Vizel.tsx:33

Initial content in Markdown format. If both initialContent and initialMarkdown are provided, initialMarkdown takes precedence.

Example

tsx
<Vizel initialMarkdown="# Hello World\n\nThis is **bold** text." />

locale?

ts
optional locale?: VizelLocale;

Defined in: packages/react/src/components/Vizel.tsx:55

Locale for translated UI strings


markdown?

ts
optional markdown?: string;

Defined in: packages/react/src/components/Vizel.tsx:92

Controlled markdown content. When set, the editor content will be synchronized with this value. Use together with onMarkdownChange for controlled mode.

Example

tsx
const [md, setMd] = useState("# Hello");
<Vizel markdown={md} onMarkdownChange={setMd} />

onBlur?

ts
optional onBlur?: (props) => void;

Defined in: packages/react/src/components/Vizel.tsx:110

Callback when editor loses focus

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

void


onCreate?

ts
optional onCreate?: (props) => void;

Defined in: packages/react/src/components/Vizel.tsx:102

Callback when editor is created

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

void


onDestroy?

ts
optional onDestroy?: () => void;

Defined in: packages/react/src/components/Vizel.tsx:104

Callback when editor is destroyed

Returns

void


onError?

ts
optional onError?: (error) => void;

Defined in: packages/react/src/components/Vizel.tsx:115

Callback when an error occurs during editor operations. Provides structured error information for logging or user feedback.

Parameters

ParameterType
errorVizelError

Returns

void


onFocus?

ts
optional onFocus?: (props) => void;

Defined in: packages/react/src/components/Vizel.tsx:108

Callback when editor gets focus

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

void


onMarkdownChange?

ts
optional onMarkdownChange?: (markdown) => void;

Defined in: packages/react/src/components/Vizel.tsx:98

Callback when markdown content changes. Called with the current markdown string when the editor content is updated. Use together with markdown for controlled mode.

Parameters

ParameterType
markdownstring

Returns

void


onSelectionUpdate?

ts
optional onSelectionUpdate?: (props) => void;

Defined in: packages/react/src/components/Vizel.tsx:106

Callback when selection changes

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

void


onUpdate?

ts
optional onUpdate?: (props) => void;

Defined in: packages/react/src/components/Vizel.tsx:100

Callback when content changes

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

void


placeholder?

ts
optional placeholder?: string;

Defined in: packages/react/src/components/Vizel.tsx:41

Placeholder text when editor is empty


showBubbleMenu?

ts
optional showBubbleMenu?: boolean;

Defined in: packages/react/src/components/Vizel.tsx:70

Whether to show the bubble menu (default: true)


showToolbar?

ts
optional showToolbar?: boolean;

Defined in: packages/react/src/components/Vizel.tsx:61

Whether to show the toolbar (default: false)


toolbarContent?

ts
optional toolbarContent?: (props) => ReactNode;

Defined in: packages/react/src/components/Vizel.tsx:68

Custom toolbar content as a render prop. Receives the bound editor instance so the consumer can drive Tiptap commands from custom controls. Mirrors the Vue &lt;slot name="toolbar" :editor&gt; and the Svelte toolbar: Snippet&lt;[{ editor }]&gt;.

Parameters

ParameterType
props{ editor: Editor; }
props.editorEditor

Returns

ReactNode


transformDiagramsOnImport?

ts
optional transformDiagramsOnImport?: boolean;

Defined in: packages/react/src/components/Vizel.tsx:39

Automatically transform diagram code blocks (mermaid, graphviz) to diagram nodes when importing markdown content. Only applies when initialMarkdown is provided.

Default

ts
true

Released under the MIT License.