Installation
npx shadcn@latest add https://platejs.org/r/media-file-nodeExamples
Loading...
Files
components/demo.tsx
'use client';
import * as React from 'react';
import { Plate, usePlateEditor } from 'platejs/react';
import { EditorKit } from '@/components/editor/editor-kit';
import { Editor, EditorContainer } from '@/components/ui/editor';
import { DEMO_VALUES } from './values/demo-values';
export default function Demo({ id }: { id: string }) {
  const editor = usePlateEditor({
    plugins: EditorKit,
    value: DEMO_VALUES[id],
  });
  return (
    <Plate editor={editor}>
      <EditorContainer variant="demo">
        <Editor />
      </EditorContainer>
    </Plate>
  );
}
Plate Plus
- Integration with UploadThing
 - Use slash commands for quick insertion
 - Displays clickable placeholders for various media types (image, video, audio, file)
 - Opens a popover with two tabs when the placeholder is clicked:
- Upload tab: Allows uploading local files directly
 - Embed tab: Enables pasting embed links for media content
 
 - Image-specific features:
- Better loading rendering and image replacement
 - Alignment options
 - Expand/collapse view
 - Download button
 
 - Video-specific features:
- Lazy load
 - Alignment options
 - Caption support
 - View original source
 
 - Floating toolbar appears at the top right of media elements:
- Alignment dropdown menu
 - Caption button
 - Expand button
 - Download button
 
 - Beautifully crafted UI