Plate
PlateEditorsCreateTemplates
GitHub16kGitHub
DiscordDiscord
  • Introduction
  • Installation
    • Plate UI
      • Next.js
      • React
    • Manual
    • RSC
    • Node.js
    • Local Docs
    • MCP
  • Releases

Plate UI

PreviousNext

Install, customize, and sync copied Plate UI components.

Plate UI is the copied component layer for Plate. Use the shadcn CLI for the fastest setup, or install components manually when you need more control.

CLI installation (recommended)

This is the fastest way to integrate Plate UI's core dependencies and base styles.

Install Plate UI

ReleasesNext.js

On This Page

CLI installation (recommended)Install Plate UIBasic usageStyles and iconsEditor colorManual installationInstall PlateAdd the editor colorAdd componentsBasic usageSync copied filesInstall the skillPick the JSON sourcePrompt your agentAgent contractComponent typesFeature kitsComponentsNode componentsToolbar componentsOther componentsEditor templatesAPI routesDocumentation
Build your editor
Production-ready AI template and reusable components.
Get all-access

If you are not using Next.js, refer to the official shadcn/ui installation guides for your specific framework before proceeding.

pnpm dlx shadcn@latest add @plate/plate-ui
pnpm dlx shadcn@latest add @plate/plate-ui

The command also adds the editor color to your global stylesheet.

Basic usage

With Plate UI's core installed, proceed to the guide specific to your framework:

  • Next.js Guide: for server-side rendered applications (Next, Remix, etc.)
  • React Guide: for single-page applications (Vite, React Router, etc.)

Styles and icons

Plate UI items match the style and icon library in your components.json, as shadcn's own components do.

Base and style matching needs a Plate registry URL that holds {style}, because the CLI puts your style only into such a URL. Set it in components.json:

components.json
{
  "registries": {
    "@plate": "https://platejs.org/r/{style}/{name}.json"
  }
}
components.json
{
  "registries": {
    "@plate": "https://platejs.org/r/{style}/{name}.json"
  }
}
  • A base-* style, such as base-nova, installs Base UI files, and a radix-* style, such as radix-luma, installs Radix files. Each file uses your style's classes.
  • A base-* or radix-* style that Plate does not serve yet installs the Nova files of its base.
  • In a base-* or radix-* style, icons come from your icon library: Lucide, Tabler, Hugeicons, Phosphor or Remix Icon.
  • The older styles new-york, new-york-v4 and default install the Radix Nova files with Lucide icons.
  • Plate UI needs Tailwind v4. In a Tailwind v3 app, such as one on shadcn's default style, the copied files and the editor color do not work.
  • Toolbar buttons use your project's own toggle and tooltip components.

Plate serves no files for shadcn's React Aria base, so an item fails to install in an aria-* style.

Editor color

Plate UI paints the editor's text selection, caret, block selection and drop line with the Tailwind color editor-primary. Installing @plate/plate-ui adds it to your global stylesheet:

app/globals.css
@theme inline {
  --color-editor-primary: var(--editor-primary, var(--primary));
}
app/globals.css
@theme inline {
  --color-editor-primary: var(--editor-primary, var(--primary));
}

The color needs Tailwind v4. It follows shadcn's --primary, so a shadcn theme recolors the editor too.

To give the editor a color of its own, add --editor-primary to your stylesheet. The install does not add it. A value in :root also applies in dark mode unless .dark sets its own:

app/globals.css
:root {
  --editor-primary: oklch(0.623 0.214 259.815);
}
 
.dark {
  --editor-primary: oklch(0.707 0.165 254.624);
}
app/globals.css
:root {
  --editor-primary: oklch(0.623 0.214 259.815);
}
 
.dark {
  --editor-primary: oklch(0.707 0.165 254.624);
}

An app without shadcn's theme has no --primary, so it must set --editor-primary.

Manual installation

If you prefer a step-by-step approach or are not using the shadcn CLI, follow these steps:

Install Plate

pnpm add platejs
pnpm add platejs
Plugin Dependencies

Plate features live at platejs/* import subpaths. Install the optional peer libraries required by the features you use. For example, AI needs @ai-sdk/react, ai, and the Markdown peer libraries. Each feature page lists its peers; the CLI installs them with copied components.

Add the editor color

Add the editor color to your global stylesheet:

app/globals.css
@theme inline {
  --color-editor-primary: var(--editor-primary, var(--primary));
}
app/globals.css
@theme inline {
  --color-editor-primary: var(--editor-primary, var(--primary));
}

Without shadcn's theme, also set --editor-primary, as Editor color shows.

Add components

With Plate UI's core installed, you can now add individual Plate UI components to build your editor interface. For example, to add the FixedToolbar and a MarkToolbarButton:

pnpm dlx shadcn@latest add @plate/fixed-toolbar @plate/mark-toolbar-button
pnpm dlx shadcn@latest add @plate/fixed-toolbar @plate/mark-toolbar-button

Import and use them in your editor:

components/editor.tsx
import { BoldPlugin, EditorRoot } from "platejs/react";
import { FixedToolbar } from "@/components/editor/fixed-toolbar";
import { MarkToolbarButton } from "@/components/editor/mark-toolbar-button";
// ... other imports
 
export function MyEditor() {
  // ... editor setup
  return (
    <EditorRoot editor={editor}>
      <FixedToolbar>
        <MarkToolbarButton plugin={BoldPlugin} tooltip="Bold">B</MarkToolbarButton>
        {/* ... other toolbar buttons ... */}
      </FixedToolbar>



Explore the available UI Components and Plugin Components to customize your editor nodes (like paragraphs, headings, etc.) and build a feature-rich editing experience.

Basic usage

With Plate UI's core installed, proceed to the guide specific to your framework:

  • Next.js Guide: for server-side rendered applications (Next, Remix, etc.)
  • React Guide: for single-page applications (Vite, React Router, etc.)

Sync copied files

Plate UI components live in your app after installation. Use this workflow when an agent needs to merge upstream registry file changes into local copies while keeping app-specific edits.

For release review, use Releases. For scoped sync data, use the raw registry JSON.

Install the skill

pnpm dlx skills add udecode/plate --skill sync-plate-ui
pnpm dlx skills add udecode/plate --skill sync-plate-ui

Pick the JSON source

Use the index for ordered update events. Use the component map when you need the events for one copied registry item.

  • Index JSON
  • Components JSON

Prompt your agent

Use sync-plate-ui to sync code-block from:
https://platejs.org/registry/changelog/index.json
Use sync-plate-ui to sync code-block from:
https://platejs.org/registry/changelog/index.json

Agent contract

  • Use /registry/changelog/index.json for ordered Plate UI update events.
  • Use /registry/changelog/components.json to find events by registry item.
  • Open event JSON for the PR, release dependency, target files, and migration notes.
  • Merge upstream file changes into the app copy; keep intentional local changes.

Component types

When installing Plate UI components, you'll encounter different types of components with consistent naming patterns. Here's what they mean:

Feature kits

Feature kits are the easiest way to add complete functionality to your editor. They bundle all necessary plugin configurations, UI components (including node renderers and toolbar items), and their underlying npm dependencies for a specific feature.

# Install the complete AI feature suite, including configuration and UI
npx shadcn@latest add @plate/ai
 
# Install drag and drop functionality with all its parts
npx shadcn@latest add @plate/dnd
# Install the complete AI feature suite, including configuration and UI
npx shadcn@latest add @plate/ai
 
# Install drag and drop functionality with all its parts
npx shadcn@latest add @plate/dnd

When in doubt about what individual components you need, start with a feature kit. It's designed to provide a working feature out-of-the-box. You can always customize or remove parts later.

Components

Node components

These components are responsible for rendering specific types of content (elements or leaves) in your editor. If you need to create your own or customize existing ones, see the Plugin Components guide.

# Install the component for rendering blockquotes
npx shadcn@latest add @plate/blockquote
 
# Install the component for rendering code text
npx shadcn@latest add @plate/code
# Install the component for rendering blockquotes
npx shadcn@latest add @plate/blockquote
 
# Install the component for rendering code text
npx shadcn@latest add @plate/code

Toolbar components

Toolbar components add interactive controls like buttons and dropdowns to your editor's toolbar.

# Add an alignment dropdown for your toolbar
npx shadcn@latest add @plate/align-toolbar-button
 
# Add a toolbar button for AI features
npx shadcn@latest add @plate/ai-toolbar-button
 
# Add a color picker dropdown for your toolbar
npx shadcn@latest add @plate/font-color-toolbar-button
# Add an alignment dropdown for your toolbar
npx shadcn@latest add @plate/align-toolbar-button
 
# Add a toolbar button for AI features
npx shadcn@latest add @plate/ai-toolbar-button
 
# Add a color picker dropdown for your toolbar
npx shadcn@latest add @plate/font-color-toolbar-button

Other components

Finally, Plate UI includes more advanced editor components as overlays, menus, block wrappers, etc.

# Install a menu for AI features
npx shadcn@latest add @plate/ai-menu
 
# Install a draggable component for reordering blocks
npx shadcn@latest add @plate/dnd
# Install a menu for AI features
npx shadcn@latest add @plate/ai-menu
 
# Install a draggable component for reordering blocks
npx shadcn@latest add @plate/dnd

These components are typically included as part of their respective Feature Kits but can be installed individually for custom setups.

Editor templates

These are pre-configured editor setups, often tailored for specific use cases or as a comprehensive starting point. You can explore all available Editor Templates.

# Install an AI-enabled editor template
npx shadcn@latest add @plate/editor-ai
 
# Install a basic editor template
npx shadcn@latest add @plate/editor-basic
# Install an AI-enabled editor template
npx shadcn@latest add @plate/editor-ai
 
# Install a basic editor template
npx shadcn@latest add @plate/editor-basic

API routes

These items provide server-side components or API route handlers necessary for certain features.

# Install AI-related API routes
npx shadcn@latest add @plate/ai-api
 
# Install a complete persistent upload provider
npx shadcn@latest add @plate/upload-r2
npx shadcn@latest add @plate/upload-s3
# Install AI-related API routes
npx shadcn@latest add @plate/ai-api
 
# Install a complete persistent upload provider
npx shadcn@latest add @plate/upload-r2
npx shadcn@latest add @plate/upload-s3

Choose one persistent provider. Each item installs @plate/upload and the shared gateway policy. Use @plate/upload-browser for browser-local demos, or install @plate/files-api directly when building a custom provider recipe. Persistent routes need storage credentials and an application access policy. See Upload Files before accepting upload requests.

Documentation

Each platejs release ships docs that match its version. See Local docs to point your coding agent at them.

{
/* ... Editor component ... */
}
</EditorRoot>
);
}
components/editor.tsx
import { BoldPlugin, EditorRoot } from "platejs/react";
import { FixedToolbar } from "@/components/editor/fixed-toolbar";
import { MarkToolbarButton } from "@/components/editor/mark-toolbar-button";
// ... other imports
 
export function MyEditor() {
  // ... editor setup
  return (
    <EditorRoot editor={editor}>
      <FixedToolbar>
        <MarkToolbarButton plugin={BoldPlugin} tooltip="Bold">B</MarkToolbarButton>
        {/* ... other toolbar buttons ... */}
      </FixedToolbar>
      {/* ... Editor component ... */}
    </EditorRoot>
  );
}