Image
- Based on TipTap's Image extension. @tiptap/extension-image
Usage
tsx
import { Image } from 'reactjs-tiptap-editor';
const extensions = [
...,
// Import Extensions Here
Image.configure({
upload: (files: File) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(URL.createObjectURL(files))
}, 500)
})
},
}),
];
Image Gif
- ImageGif is a node extension that allows you to add an ImageGif to your editor.
- More: ImageGif
Props
ts
interface IImageOptions extends GeneralOptions<IImageOptions> {
/** Function for uploading files */
upload?: (file: File) => Promise<string>
HTMLAttributes?: any
acceptMimes?: string[]
maxSize?: number
/** The source URL of the image */
resourceImage: 'upload' | 'link' | 'both'
}