Feature Options
Configuration types for all editor features.
EdituFeatureOptions
Main configuration for all editor features.
typescript
interface EdituFeatureOptions {
/** Slash command menu (type "/" to open) */
slashCommand?: EdituSlashCommandOptions | boolean;
/** Table support with column/row controls */
table?: EdituTableOptions | boolean;
/** Link extension with autolink and paste support */
link?: EdituLinkOptions | boolean;
/** Image upload and resize */
image?: EdituImageFeatureOptions | boolean;
/** Markdown import/export support */
markdown?: EdituMarkdownOptions | boolean;
/** Task list (checkbox) support */
taskList?: EdituTaskListExtensionsOptions | boolean;
/** Character and word count tracking */
characterCount?: EdituCharacterCountOptions | boolean;
/** Text color and highlight support */
textColor?: EdituTextColorOptions | boolean;
/** Code block with syntax highlighting */
codeBlock?: EdituCodeBlockOptions | boolean;
/** Mathematics (LaTeX) support with KaTeX rendering */
mathematics?: EdituMathematicsOptions | boolean;
/** Drag handle for block reordering */
dragHandle?: EdituDragHandleOptions | boolean;
/** URL embedding with oEmbed/OGP support */
embed?: EdituEmbedOptions | boolean;
/** Collapsible content blocks (accordion) */
details?: EdituDetailsOptions | boolean;
/** Callout/admonition blocks (info, warning, danger, tip, note) */
callout?: EdituCalloutOptions | boolean;
/** Diagram support (Mermaid, GraphViz) */
diagram?: EdituDiagramOptions | boolean;
/** Wiki links ([[page-name]], [[page|display text]]) */
wikiLink?: EdituWikiLinkOptions | boolean;
/** @mention autocomplete (disabled by default) */
mention?: EdituMentionOptions | boolean;
/** Table of Contents block that auto-collects headings */
tableOfContents?: EdituTableOfContentsOptions | boolean;
/** Superscript text formatting */
superscript?: boolean;
/** Subscript text formatting */
subscript?: boolean;
/** Typography transformations (smart quotes, em dashes) */
typography?: boolean;
/** Comment/annotation marks for collaborative review */
comment?: EdituCommentMarkOptions | boolean;
/** Real-time collaboration mode (disables History extension) */
collaboration?: boolean;
}Slash Command
typescript
interface EdituSlashCommandOptions {
/** Custom slash command items */
items?: EdituSlashCommandItem[];
/** Suggestion configuration */
suggestion?: Partial<SuggestionOptions<EdituSlashCommandItem>>;
}
interface EdituSlashCommandItem {
/** Display title */
title: string;
/** Description text */
description: string;
/** Icon identifier (Iconify format) */
icon: EdituSlashCommandIconName;
/** Command to execute */
command: (props: { editor: Editor; range: EdituSlashCommandRange }) => void;
/** Search keywords */
keywords?: string[];
/** Group identifier */
group?: string;
}
type EdituSlashCommandIconName =
| 'lucide:heading-1'
| 'lucide:heading-2'
| 'lucide:heading-3'
| 'lucide:pilcrow'
| 'lucide:list'
| 'lucide:list-ordered'
| 'lucide:list-todo'
| 'lucide:quote'
| 'lucide:code'
| 'lucide:image'
| 'lucide:minus'
| 'lucide:table'
| 'lucide:chevrons-down-up'
| 'lucide:link'
| 'lucide:sigma'
| 'lucide:git-branch'
| string; // Any Iconify iconImage
typescript
interface EdituImageFeatureOptions {
/** Enable image resizing */
resize?: boolean;
/** Custom upload handler */
onUpload?: (file: File) => Promise<string>;
/** Maximum file size in bytes */
maxFileSize?: number;
/** Allowed MIME types */
allowedTypes?: string[];
/** Validation error callback */
onValidationError?: (error: EdituImageValidationError) => void;
/** Upload error callback */
onUploadError?: (error: Error, file: File) => void;
}
interface EdituImageValidationError {
type: 'file_too_large' | 'invalid_type';
message: string;
file: File;
}Link
typescript
interface EdituLinkOptions {
/** Open links on click */
openOnClick?: boolean;
/** Auto-link URLs while typing */
autolink?: boolean;
/** Link pasted URLs */
linkOnPaste?: boolean;
/** Default protocol for links */
defaultProtocol?: string;
/** HTML attributes for links */
HTMLAttributes?: Record<string, string>;
}Markdown
typescript
interface EdituMarkdownOptions {
/** Indentation settings */
indentation?: {
style: 'space' | 'tab';
size: number;
};
/** Enable GitHub Flavored Markdown */
gfm?: boolean;
/** Convert newlines to <br> */
breaks?: boolean;
}Character Count
typescript
interface EdituCharacterCountOptions {
/** Maximum characters (null = unlimited) */
limit?: number | null;
/** Counting mode */
mode?: 'textSize' | 'nodeSize';
/** Custom word counter function */
wordCounter?: (text: string) => number;
}Text Color
typescript
interface EdituTextColorOptions {
/** Custom text color palette */
textColors?: EdituColorDefinition[];
/** Custom highlight color palette */
highlightColors?: EdituColorDefinition[];
/** Enable multicolor highlights */
multicolor?: boolean;
}
interface EdituColorDefinition {
name: string;
color: string;
}Code Block
typescript
interface EdituCodeBlockOptions {
/** Default language for new code blocks */
defaultLanguage?: string;
/** Show line numbers */
lineNumbers?: boolean;
/** Custom Lowlight instance */
lowlight?: ReturnType<typeof createLowlight>;
}Mathematics
typescript
interface EdituMathematicsOptions {
/** KaTeX rendering options */
katexOptions?: KatexOptions;
/** Enable $...$ input rules */
inlineInputRules?: boolean;
/** Enable $$...$$ input rules */
blockInputRules?: boolean;
}Embed
typescript
interface EdituEmbedOptions {
/** Custom fetch function for embed data */
fetchEmbedData?: EdituFetchEmbedDataFn;
/** Custom or additional providers */
providers?: EdituEmbedProvider[];
/** HTML attributes for embed wrapper */
HTMLAttributes?: Record<string, unknown>;
/** Enable paste handler */
pasteHandler?: boolean;
/** Inline embeds vs block embeds */
inline?: boolean;
}
interface EdituEmbedProvider {
/** Provider name (e.g., 'youtube', 'twitter') */
name: string;
/** URL patterns to match */
patterns: RegExp[];
/** oEmbed API endpoint (optional) */
oEmbedEndpoint?: string;
/** Whether the oEmbed endpoint supports CORS */
supportsCors?: boolean;
/** Transform function for URL (e.g., extract video ID) */
transform?: (url: string) => string;
}Diagram
typescript
interface EdituDiagramOptions {
/** Mermaid configuration */
mermaidConfig?: MermaidConfig;
/** GraphViz layout engine */
graphvizEngine?: 'dot' | 'neato' | 'fdp' | 'sfdp' | 'twopi' | 'circo';
/** Default diagram type */
defaultType?: 'mermaid' | 'graphviz';
/** Default Mermaid code */
defaultCode?: string;
/** Default GraphViz code */
defaultGraphvizCode?: string;
}Other Feature Options
typescript
interface EdituDragHandleOptions {
/** Whether to show the drag handle */
enabled?: boolean;
}
interface EdituDetailsOptions {
/** Details container options */
details?: DetailsNodeOptions;
/** Content area options */
detailsContent?: DetailsContentOptions;
/** Summary/header options */
detailsSummary?: DetailsSummaryOptions;
}
interface EdituTaskListExtensionsOptions {
/** Options for the task list extension */
taskList?: EdituTaskListOptions;
/** Options for the task item extension */
taskItem?: EdituTaskItemOptions;
}Wiki Link
typescript
interface EdituWikiLinkOptions {
/** Resolve a page name to a URL (default: (p) => '#' + p) */
resolveLink?: (pageName: string) => string;
/** Check if a page exists for visual differentiation (default: () => true) */
pageExists?: (pageName: string) => boolean;
/** Get page suggestions for autocomplete */
getPageSuggestions?: (query: string) => EdituWikiLinkSuggestion[];
/** Callback when a wiki link is clicked */
onLinkClick?: (pageName: string, event: MouseEvent) => void;
/** CSS class for existing page links (default: 'editu-wiki-link--existing') */
existingClass?: string;
/** CSS class for non-existing page links (default: 'editu-wiki-link--new') */
newClass?: string;
/** Additional HTML attributes */
HTMLAttributes?: Record<string, unknown>;
}
interface EdituWikiLinkSuggestion {
/** Page name */
name: string;
/** Optional display label (defaults to name) */
label?: string;
}Comment Mark
typescript
interface EdituCommentMarkOptions {
/** Additional HTML attributes for comment marks */
HTMLAttributes?: Record<string, string>;
/** Callback when a comment mark is clicked */
onCommentClick?: (commentId: string) => void;
}TIP
Comment mark options control the editor extension for highlighting commented text. For full comment management (storage, replies, resolution), use the framework-specific hooks/composables/runes: useEdituComment or createEdituComment.
Collaboration
The collaboration feature option is a boolean flag. Setting it to true disables the built-in History extension (since Yjs handles undo/redo via y-undo).
typescript
// Enable collaboration mode
const editor = useEdituEditor({
features: {
collaboration: true, // disables History extension
},
extensions: [
Collaboration.configure({ document: ydoc }),
CollaborationCursor.configure({ provider, user }),
],
});WARNING
You must install and configure yjs, a Yjs provider, @tiptap/extension-collaboration, and @tiptap/extension-collaboration-cursor separately. See the Collaboration Guide for details.