2020-10-27 22:32:55 +08:00
# Image
2021-01-25 17:35:52 +08:00
[![Version ](https://img.shields.io/npm/v/@tiptap/extension-image.svg?label=version )](https://www.npmjs.com/package/@tiptap/extension-image)
[![Downloads ](https://img.shields.io/npm/dm/@tiptap/extension-image.svg )](https://npmcharts.com/compare/@tiptap/extension-image?minimal=true)
2020-11-03 23:43:35 +08:00
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 doesn’ t upload images to your server, that’ s a whole different story.
:::
2020-10-27 22:32:55 +08:00
## Installation
```bash
2020-10-30 21:24:16 +08:00
# with npm
2020-10-27 22:32:55 +08:00
npm install @tiptap/extension -image
2020-10-30 21:24:16 +08:00
# with Yarn
2020-10-27 22:32:55 +08:00
yarn add @tiptap/extension -image
```
2020-10-30 23:57:55 +08:00
## Settings
2020-11-18 19:12:34 +08:00
| 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. |
2020-10-30 23:57:55 +08:00
2020-10-27 22:32:55 +08:00
## Source code
2021-04-21 21:31:11 +08:00
[packages/extension-image/ ](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-image/ )
2020-10-27 22:32:55 +08:00
## Usage
2021-08-26 05:10:20 +08:00
< tiptap-demo name = "Nodes/Image" > < / tiptap-demo >