Skip to content

Latest commit

 

History

History
108 lines (81 loc) · 1.76 KB

cloud.mdx

File metadata and controls

108 lines (81 loc) · 1.76 KB
title description component docs
Cloud
Integrate cloud functionality to enable seamless access to cloud-based resources.
true
route title
/docs/cloud
Cloud

Installation

CLI Manual
npx shadcx@latest add cloud -r plate-ui

Install the following dependencies:

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Examples

Usage

const plugins = createMyPlugins(
  [
    ...basicNodesPlugins,
    createCloudPlugin({
      options: {},
    }),
    createCloudAttachmentPlugin(),
    createCloudImagePlugin({
      options: {
        maxInitialWidth: 320,
        maxInitialHeight: 320,
        minResizeWidth: 100,
        maxResizeWidth: 720,
      },
    }),
  ],
  {
    components: {
      ...plateUI,
      [CloudAttachmentPlugin.key]: CloudAttachmentElement,
      [CloudImagePlugin.key]: CloudImageElement,
    },
  }
);

Demo

export default function CloudDemo() {
  return (
    <Plate<MyValue> plugins={plugins} initialValue={cloudValue}>
      <FixedToolbar>
        <CloudToolbarButtons />
      </FixedToolbar>
      <Editor />
    </Plate>
  );
}