slash-editor
API Reference

@slash-editor/core

Extensions, schema, commands, and serializers. No React, no CSS.

The engine: Tiptap/ProseMirror extensions, the baseline schema, and the commands each extension adds. Nothing here touches React or renders a class name — the UI layer (a registry component, or your own) owns markup and styling entirely.

createBlockKit

createBlockKit(options?: BlockKitOptions): Extensions

The baseline schema useSlashEditor's blockKit option configures. See the block kit guide for the full option reference and the opt-out pattern for custom NodeViews.

Slash commands

defaultSlashItems: SlashItem[]
filterSlashItems(items: SlashItem[], query: string, editor?: Editor): SlashItem[]

See the slash items guide.

Upload contract

interface UploadAdapter<TResult extends UploadResult = UploadResult> {
  upload(file: File, context: UploadContext): Promise<TResult>;
}
runUpload(options): void
retryUpload(options): boolean

Shared by image, file, and video. See the upload adapter guide.

AI stream contract

interface StreamAdapter {
  stream(request: AiRequest, context: StreamContext): AsyncIterable<string>;
}
defaultAiSlashActions: AiSlashAction[]
createAiSlashItems(options): SlashItem[]

See the AI stream adapter guide.

Collaboration

collaboration(options: CollaborationOptions): Extensions

Wraps Tiptap's official Collaboration/CollaborationCaret over y-prosemirror. See the collaboration guide.

Comments

comment(options?: Partial<CommentOptions>): Mark
activeThreadIds(state: EditorState): string[]

The mark anchors a thread id only — thread bodies live in a host-provided CommentThreadStore. See the comments guide.

Mentions

mention(options: Partial<MentionOptions> & Pick<MentionOptions, "items">): Node

See the mentions guide.

Markdown

// @slash-editor/core/markdown
markdown(options?: Partial<MarkdownOptions>): Extension
serializeMarkdown(doc: JSONContent, extensions?: Extensions): string
parseMarkdown(markdown: string, extensions?: Extensions): JSONContent

A separate entry, so marked stays out of bundles that don't import it. See Markdown.

Baseline nodes and marks

Callout, Toggle (Tiptap's Details plus a heading level and Notion shorthands > / # >/## >/### >), Quote (blockquote whose shorthand is ", freeing > for the toggle), Image, File, Video, Embed, TableKit, Column/Columns, Placeholder, BlockId, BlockDrag, BubbleToolbar, LinkEditor, SlashCommand — each individually opt-out-able from createBlockKit via false, and each exported directly for direct extension (Image.extend({ ... })) when you need a custom NodeView.

On this page