Portive

Premade Elements

The slate-portive plugin includes these premade elements that you can use or customize:

ImageBlock

Import statement:

import { ImageBlockElement, ImageBlock, createImageBlock } from "slate-portive"
  • TypeScript type: ImageBlockElement
  • Element type: image-block
  • Component: ImageBlock
  • createImageFileElement: createImageBlock
  • isVoid: true
  • isInline: false

TitledImageBlock

Import statement:

import {
  TitledImageBlockElement,
  TitledImageBlock,
  createTitledImageBlock,
} from "slate-portive"
  • Element type: titled-image-block
  • TypeScript type: TitledImageBlockElement
  • Component: TitledImageBlock
  • createImageFileElement: createTitledImageBlock
  • isVoid: true
  • isInline: false

ImageInline

Import statement:

import {
  ImageInlineElement,
  ImageInline,
  createImageInline,
} from "slate-portive"
  • Element type: image-inline
  • TypeScript type: ImageInlineElement
  • Component: ImageInline
  • createImageFileElement: createImageInline
  • isVoid: true
  • isInline: true

AttachmentBlock

Import statement:

import {
  AttachmentBlockElement,
  AttachmentBlock,
  createAttachmentBlock,
} from "slate-portive"
  • Element type: attachment-block
  • TypeScript type: AttachmentBlockElement
  • Component: AttachmentBlock
  • createFileElement: createAttachmentBlock
  • isVoid: true
  • isInline: false