slash-editor
Components

Media & AI Node Views

ReactNodeViewRenderer targets for image, file, video, embed, and an AI block — upload/retry chrome shared across image/file/video.

Type /image, /file, /video, or /embed in the preview to try one.

Installation

bunx --bun shadcn@latest add @slash-editor/node-views

Usage

The adapter is always a prop, never a hardcoded mock — wire your own UploadAdapter:

image.extend({
  addNodeView: () =>
    ReactNodeViewRenderer((props) => <ImageNodeView {...props} adapter={yourUploadAdapter} />),
});

To display signed or authorized URLs, configure the node's display-only resolveSrc before extending it — the views pass the stored URL through it, while the document keeps the original:

Image.configure({ resolveSrc: (src) => signUrl(src) }).extend({
  addNodeView: () =>
    ReactNodeViewRenderer((props) => <ImageNodeView {...props} adapter={yourUploadAdapter} />),
});

See the upload adapter guide for the full UploadAdapter contract, including retry, toAttrs, and resolveSrc.

On this page