@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): ExtensionsThe 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): booleanShared by image, file, and video, each of which also takes toAttrs (map the upload result
onto node attrs, default { src: result.url }) and, with embed, a display-only resolveSrc.
See the upload adapter guide.
AI stream contract
interface StreamAdapter {
stream(request: AiRequest, context: StreamContext): AsyncIterable<string>;
}
defaultAiActions: AiAction[]
createAiSlashItems(actions): SlashItem[]See the AI stream adapter guide.
Collaboration
collaboration(options: CollaborationOptions): ExtensionsWraps 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">): NodeSee the mentions guide.
Code block
// @slash-editor/core/code-block
CodeBlock: Node<CodeBlockOptions> // for .extend({ addNodeView })
codeBlock(options?: Partial<CodeBlockOptions>): Node // options.lowlight picks the grammarsA separate entry, so lowlight stays out of bundles that keep the plain code block. Opt in with
createBlockKit({ codeBlock: codeBlock() }). See the
Code Block Node View.
Emoji
// @slash-editor/core/emoji
emoji(options?: Partial<EmojiOptions>): Node
searchEmojis(emojis: EmojiItem[], query: string, limit: number): EmojiItem[]A separate entry, so the emoji dataset stays out of bundles that never enable the picker. Opt in
with createBlockKit({ emoji: emoji() }). See the emoji guide.
Pages
pages(options: PagesOptions): Extensions
createPagesSlashItems(): SlashItem[]
withPageMentions(mention, options: PagesOptions): MentionOptions
collectPageRefs(doc: JSONContent): { subPages: string[]; links: string[] }
getPagesOptions(editor: Editor): PagesOptions | undefined
pageTitle(page: Pick<PageMeta, "title"> | undefined, untitled?: string): stringTypes PageMeta, PageStore, PagesOptions and nodes SubPage/PageLink (bare, store-less) are
exported too. The kit builds all of it from createBlockKit({ pages }). See the
pages guide.
Markdown
// @slash-editor/core/markdown
markdown(options?: Partial<MarkdownOptions>): Extension
serializeMarkdown(doc: JSONContent, extensions?: Extensions): string
parseMarkdown(markdown: string, extensions?: Extensions): JSONContentA 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.