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
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-uipnpm dlx shadcn@latest add @plate/plate-uiBasic 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.)
Manual Installation
If you prefer a step-by-step approach or are not using the shadcn CLI, follow these steps:
Install Plate
pnpm add platejspnpm add platejsWhen manually installing Plate, you'll need to add the specific packages for each plugin you want to use. For example, if you want to use the AIMenu component, you would need @platejs/ai and its dependencies. Check each component's documentation for its required packages, or use the CLI to automatically install the required packages.
Configure CSS Variables
Add the following CSS variables to your global stylesheet:
:root {
/* Base brand color for Plate UI components */
--brand: oklch(0.623 0.214 259.815);
}
.dark {
--brand: oklch(0.707 0.165 254.624);
}:root {
/* Base brand color for Plate UI components */
--brand: oklch(0.623 0.214 259.815);
}
.dark {
--brand: oklch(0.707 0.165 254.624);
}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-buttonpnpm dlx shadcn@latest add @plate/fixed-toolbar @plate/mark-toolbar-buttonImport and use them in your editor:
import { Plate } from "platejs/react";
import { FixedToolbar } from "@/components/ui/fixed-toolbar";
import { MarkToolbarButton } from "@/components/ui/mark-toolbar-button";
// ... other imports
export function MyEditor() {
// ... editor setup
return (
<Plate editor={editor}>
<FixedToolbar>
<MarkToolbarButton nodeType="bold" tooltip="Bold">B</MarkToolbarButton>
{/* ... other toolbar buttons ... */}
</FixedToolbar>
{/* ... Editor component ... */}
</Plate>
);
}import { Plate } from "platejs/react";
import { FixedToolbar } from "@/components/ui/fixed-toolbar";
import { MarkToolbarButton } from "@/components/ui/mark-toolbar-button";
// ... other imports
export function MyEditor() {
// ... editor setup
return (
<Plate editor={editor}>
<FixedToolbar>
<MarkToolbarButton nodeType="bold" tooltip="Bold">B</MarkToolbarButton>
{/* ... other toolbar buttons ... */}
</FixedToolbar>
{/* ... Editor component ... */}
</Plate>
);
}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 sync-plate-uipnpm dlx skills add sync-plate-uiPick the JSON source
Use the index for ordered update events. Use the component map when you need the events for one copied registry item.
Prompt your agent
Use sync-plate-ui to sync code-block-node from:
https://platejs.org/registry/changelog/index.jsonUse sync-plate-ui to sync code-block-node from:
https://platejs.org/registry/changelog/index.jsonAgent contract
- Use
/registry/changelog/index.jsonfor ordered Plate UI update events. - Use
/registry/changelog/components.jsonto 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-kit
# Install drag and drop functionality with all its parts
npx shadcn@latest add @plate/dnd-kit# Install the complete AI feature suite, including configuration and UI
npx shadcn@latest add @plate/ai-kit
# Install drag and drop functionality with all its parts
npx shadcn@latest add @plate/dnd-kitWhen 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-node
# Install the component for rendering code text
npx shadcn@latest add @plate/code-node# Install the component for rendering blockquotes
npx shadcn@latest add @plate/blockquote-node
# Install the component for rendering code text
npx shadcn@latest add @plate/code-nodeToolbar 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-buttonOther 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/block-draggable# 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/block-draggableThese 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-basicAPI 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 file upload API routes (e.g., for UploadThing)
npx shadcn@latest add @plate/media-uploadthing-api# Install AI-related API routes
npx shadcn@latest add @plate/ai-api
# Install file upload API routes (e.g., for UploadThing)
npx shadcn@latest add @plate/media-uploadthing-apiDocumentation
Documentation files for various Plate features, guides, and API references can also be added to your local project. This is especially useful for keeping version-specific documentation alongside your code and for providing context to AI tools through MCP. Learn more about setting up local documentation.
# Add AI documentation
npx shadcn@latest add @plate/ai-docs
# Add Plate Plugin documentation
npx shadcn@latest add @plate/plugin-docs# Add AI documentation
npx shadcn@latest add @plate/ai-docs
# Add Plate Plugin documentation
npx shadcn@latest add @plate/plugin-docsThese items consists of Markdown files, which can be integrated into your own documentation system or made available for local search and AI consumption.
On This Page
CLI Installation (Recommended)Install Plate UIBasic UsageManual InstallationInstall PlateConfigure CSS VariablesAdd ComponentsBasic UsageSync copied filesInstall the skillPick the JSON sourcePrompt your agentAgent contractComponent TypesFeature KitsComponentsNode ComponentsToolbar ComponentsOther ComponentsEditor TemplatesAPI RoutesDocumentation