If you are not using Next.js, refer to the official shadcn/ui installation guides for your specific framework before proceeding.
The command also adds the editor color to your global stylesheet.
With Plate UI's core installed, proceed to the guide specific to your framework:
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:
{
"registries": {
"@plate": "https://platejs.org/r/{style}/{name}.json"
}
}{
"registries": {
"@plate": "https://platejs.org/r/{style}/{name}.json"
}
}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.base-* or radix-* style that Plate does not serve yet installs the Nova files of its base.base-* or radix-* style, icons come from your icon library: Lucide, Tabler, Hugeicons, Phosphor or Remix Icon.new-york, new-york-v4 and default install the Radix Nova files with Lucide icons.default style, the copied files and the editor color do not work.toggle and tooltip components.Plate serves no files for shadcn's React Aria base, so an item fails to install in an aria-* style.
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:
@theme inline {
--color-editor-primary: var(--editor-primary, var(--primary));
}@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:
:root {
--editor-primary: oklch(0.623 0.214 259.815);
}
.dark {
--editor-primary: oklch(0.707 0.165 254.624);
}: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.
If you prefer a step-by-step approach or are not using the shadcn CLI, follow these steps:
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 to your global stylesheet:
@theme inline {
--color-editor-primary: var(--editor-primary, var(--primary));
}@theme inline {
--color-editor-primary: var(--editor-primary, var(--primary));
}Without shadcn's theme, also set --editor-primary, as Editor color shows.
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:
Import and use them in your editor:
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.
With Plate UI's core installed, proceed to the guide specific to your framework:
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.
Use the index for ordered update events. Use the component map when you need the events for one copied registry item.
Use sync-plate-ui to sync code-block from:
https://platejs.org/registry/changelog/index.jsonUse sync-plate-ui to sync code-block from:
https://platejs.org/registry/changelog/index.json/registry/changelog/index.json for ordered Plate UI update events./registry/changelog/components.json to find events by registry item.When installing Plate UI components, you'll encounter different types of components with consistent naming patterns. Here's what they mean:
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/dndWhen 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.
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/codeToolbar 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-buttonFinally, 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/dndThese components are typically included as part of their respective Feature Kits but can be installed individually for custom setups.
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-basicThese 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-s3Choose 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.
Each platejs release ships docs that match its version. See
Local docs to point your coding agent at them.
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>
);
}