Files
tiptap/docs/api/nodes/image.md
2021-10-02 00:14:44 +02:00

1.6 KiB
Raw Blame History

Image

Version Downloads

Use this extension to render <img> HTML tags. By default, those images are blocks. If you want to render images in line with text set the inline option to true.

:::warning Restrictions This extension does only the rendering of images. It doesnt upload images to your server, thats a whole different story. :::

Installation

# with npm
npm install @tiptap/extension-image

# with Yarn
yarn add @tiptap/extension-image

Settings

Option Type Default Description
HTMLAttributes Object {} Custom HTML attributes that should be added to the rendered HTML tag.
inline Boolean false Renders the image node inline.

Commands

setImage()

Makes the current node an image.

editor.commands.setImage({ src: 'https://example.com/foobar.png')
editor.commands.setImage({ src: 'https://example.com/foobar.png', alt: 'A boring example image', title: 'An example' })

Source code

packages/extension-image/

Usage