Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-image

Package Overview
Dependencies
Maintainers
5
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-image

image extension for tiptap

  • 2.7.0-pre.0
  • pre
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
481K
increased by11.91%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-image?

@tiptap/extension-image is an extension for the Tiptap editor that allows users to easily add and manipulate images within their rich text content. It provides a range of functionalities to insert, resize, and align images, making it a versatile tool for enhancing text with visual content.

What are @tiptap/extension-image's main functionalities?

Insert Image

This feature allows users to insert an image into the editor. The code sample demonstrates how to initialize the editor with the Image extension and insert an image by specifying its source URL.

import { Image } from '@tiptap/extension-image';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Image,
  ],
});

editor.chain().focus().setImage({ src: 'https://example.com/image.jpg' }).run();

Resize Image

This feature enables users to resize an image by setting its width and height. The code sample shows how to set the dimensions of an image within the editor.

editor.chain().focus().setNode('image', { src: 'https://example.com/image.jpg', width: 300, height: 200 }).run();

Align Image

This feature allows users to align an image within the text. The code sample demonstrates how to align an image to the right by applying a CSS style.

editor.chain().focus().setNode('image', { src: 'https://example.com/image.jpg', style: 'float: right;' }).run();

Other packages similar to @tiptap/extension-image

Keywords

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc