Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

plate

БесплатноБез исполняемых скриптовНе проверен

Plate is a plugin-based rich-text editor framework for React, built on Slate, with optional shadcn/ui components, Markdown import/export and Yjs real-time…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Plate — plugin-based rich-text editor for React

Overview

Plate wraps Slate in a plugin system: every feature (bold, headings, lists, tables, Markdown, collaboration) is a plugin with its own transforms, keyboard handling and optional React component. The document is plain JSON (Value, an array of nodes such as { type: 'p', children: [{ text: 'Hi' }] }), so it is easy to store, diff and migrate.

The packages were renamed in v49: the old @udecode/plate-* packages are gone, and everything now lives in platejs plus scoped @platejs/* packages. This skill was checked against platejs 53.5.x (MIT licensed). Pin the major version in package.json because plugin and package boundaries have changed between majors.

Import paths follow one rule: platejs and @platejs/* are headless and run in Node.js; platejs/react and @platejs/*/react are the browser editor. Use the base entrypoints in scripts and server code.

Instructions

Installation (headless, no UI kit)

npm install platejs@53 @platejs/basic-nodes@53

TypeScript needs "moduleResolution": "bundler" (TypeScript 5+) because the packages are ESM-only:

{ "compilerOptions": { "module": "esnext", "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true } }

Installation (styled editor with shadcn/ui)

In a project that already has shadcn/ui set up, the registry installs ready-made components and plugin kits into your source tree, where you own and edit them:

npx shadcn@latest add @plate/plate-ui
npx shadcn@latest add @plate/editor

@plate/editor is the documented Next.js starting point. Feature kits such as @plate/basic-nodes-kit wire a plugin and its UI together. This command copies files into your project, so run it on a clean git tree and review the diff.

Create a minimal editor

import type { Value } from 'platejs';
import { BoldPlugin, H1Plugin, ItalicPlugin } from '@platejs/basic-nodes/react';
import { Plate, PlateContent, usePlateEditor } from 'platejs/react';

const initialValue: Value = [
  { type: 'h1', children: [{ text: 'Q4 launch plan' }] },
  { type: 'p', children: [{ text: 'Ship the ' }, { text: 'beta', bold: true }, { text: ' by Friday.' }] },
];

export function NoteEditor() {
  const editor = usePlateEditor({
    plugins: [BoldPlugin, ItalicPlugin, H1Plugin],
    value: initialValue,
  });
  return (
    <Plate editor={editor} onChange={({ value }) => localStorage.setItem('note', JSON.stringify(value))}>
      <PlateContent placeholder="Write something..." />
    </Plate>
  );
}

usePlateEditor memoizes the editor; createPlateEditor (also from platejs/react) does not. Marks render as <strong>, <em> and <u> by default. To trigger formatting from your own toolbar call editor.tf.bold.toggle().

Render a node with your own component

Block plugins take a component through withComponent:

import { H1Plugin } from '@platejs/basic-nodes/react';
import { PlateElement, type PlateElementProps } from 'platejs/react';

function H1Element(props: PlateElementProps) {
  return <PlateElement as="h1" className="text-3xl font-bold" {...props} />;
}

const plugins = [H1Plugin.withComponent(H1Element)];

Markdown import and export (Node.js or browser)

npm install @platejs/markdown@53
import { BaseBasicBlocksPlugin, BaseBasicMarksPlugin } from '@platejs/basic-nodes';
import { MarkdownPlugin, deserializeMd, serializeMd } from '@platejs/markdown';
import { createSlateEditor } from 'platejs';

const editor = createSlateEditor({
  plugins: [BaseBasicBlocksPlugin, BaseBasicMarksPlugin, MarkdownPlugin],
});
const value = deserializeMd(editor, '# Release notes\n\nShipped **v2** today.');
console.log(serializeMd(editor, { value }));

Output of the round trip is # Release notes and Shipped **v2** today. separated by a blank line. createSlateEditor is the non-React editor, so this runs in scripts, API routes and migrations. Register a plugin for every node type that appears in the content: the Markdown - item syntax produces ul/li nodes that are only serialized back if the list plugin (@platejs/list) is registered too.

Bulk transforms on a document

const editor = createSlateEditor({ plugins: [BaseBasicBlocksPlugin], value });
editor.tf.setNodes({ type: 'h2' }, { at: [], match: (n) => 'type' in n && n.type === 'h1' });
const plain = editor.api.string([]);

Pass at: [] to apply a transform to the whole document, then read editor.children for the new value.

Real-time collaboration with Yjs

npm install @platejs/yjs@53 @hocuspocus/provider
import { useEffect } from 'react';
import { YjsPlugin } from '@platejs/yjs/react';
import { Plate, PlateContent, usePlateEditor } from 'platejs/react';

export function SharedEditor({ docId, user }: { docId: string; user: { name: string; color: string } }) {
  const editor = usePlateEditor({
    plugins: [
      YjsPlugin.config
Полный SKILL.md на GitHub

Установить plate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл plate?

Plate is a plugin-based rich-text editor framework for React, built on Slate, with optional shadcn/ui components, Markdown import/export and Yjs real-time collaboration. Use it when a user asks to "add a rich text editor to a React app", "build a Notion-style editor with Plate", "serialize Plate content to Markdown", "add collaboration to a Plate editor", or "migrate from @udecode/plate-* to platejs". Covers the current platejs and @platejs/* packages, not the pre-v49 @udecode/plate-* ones.

Как установить скилл plate?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл plate запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить plate с