Plate ui

From udecode/plate · View interactive version

Plate ui is an AI agent skill from the GitHub repository udecode/plate. Use before editing any file under the registry components or kits, or a component's drag, drop, handle menu or indicator UI. Implements Plate React component families, copied registry UI and kit wiring with exact browser proof.

How to use this skill

Skill file

Plate UI

Use the shadcn skill for CLI, upstream docs, and generic shadcn/ui rules.

Use vercel-react-best-practices for selected implementation tactics.

docs/vision/plate.md (Plugin and component doctrine) owns Plate React and

component law: component shape, family topology, extraction boundaries,

cross-platform layering and React performance. This skill owns the method that

applies it: open-code preservation, the base/live kit split, registry wiring

and browser proof.

Repo Surfaces

features, live/static components, and app-owned kit values

install over the same flat editor targets

plate-plugins

Routing Gate

Ownership follows the Routing table in AGENTS.md.

Continue here whenever a Plate package or registry task makes a React,

component, hook, provider, store, primitive, or composition decision. Package

implementation and proof still route to plate-plugins; plugin builders,

schema law, and application typing remain outside this skill.

Principles

  1. Preserve open code. A shadcn-derived component should still look like source code a user can own, read, diff, and tweak.
  2. Registry wiring is part of authorship. A component is not done until kits, examples, and style deps are coherent.
  3. Examples teach the install shape. Do not remove an explicit feature

plugin, kit, renderer binding, or dependency merely because an aggregate

application editor installed by the editor-kit registry item also includes

it. Deliberate repetition can make copied code and feature ownership

transparent.

Registry

Registry Wiring → [registry.md](./rules/registry.md)

registry-examples.ts together.

Registry Changelog

install shape, or generated registry changelog changes need a registry

changelog entry or a concrete N/A reason.

verification. Do not duplicate the entry contract here.

Styling And Vercel Tactics

Use stable kebab-case data-slot for component identity and data-state for

interaction and visual state. Keep Tailwind v4 syntax canonical: slash opacity,

parenthesized CSS variables, suffix !, and canonical utilities.

vercel-react-best-practices provides selected implementation tactics. It

does not decide Plate public APIs, extraction, file ownership, or provider

visibility.

doctrine.

or effects. It never requires multiple public hooks or files.

need real independent composition. They do not automatically earn a public

provider or store.

the component law in Vision.

Key Patterns

// Good: simple component owns its own renderer behavior directly.
function MediaImage(props: EditorElementProps<typeof ImagePlugin>) {
  const selected = useSelected();

  return <EditorElement {...props} data-selected={selected || undefined} />;
}

// Good: one reusable family controller coordinates complex siblings.
const tableResize = useTableResizeController();

// Good: host-owned app code outside copied registry UI uses its inferred editor.
const api = editor.api.comments;

// Good: copied suggestion UI calls the descriptor that owns the view.
const authored = editor.plugin(AuthoredPlugin);

authored.api.setView({ intent: 'propose' });

// Good: feature-owned cross-feature integration checks the optional portal.
const optionalComments = editor.plugin(CommentsPlugin);

if (optionalComments.installed) {
  optionalComments.api.setActive([threadId]);
}

// Good: package core owns commands/state, platform UI composes locally.
const canToggleBold = bridgeState.canToggleBold;
const onPress = () => editor.plugin(BoldPlugin).update.toggle();
return <Button disabled={!canToggleBold} onClick={onPress}>Bold</Button>;

// Good: base/live split stays explicit.
export const BaseFootnoteKit = [
  BaseFootnoteReferencePlugin.configure({
    component: FootnoteReferenceElementStatic,
  }),
  BaseFootnoteDefinitionPlugin.configure({
    component: FootnoteDefinitionElementStatic,
  }),
];

export const FootnoteKit = [
  FootnoteReferencePlugin.configure({
    component: FootnoteReferenceElement,
    slots: { afterEditable: FootnoteCombobox },
  }),
  FootnoteDefinitionPlugin.configure({ component: FootnoteDefinitionElement }),
];

// Good: runtime-neutral policy is shared by both editor presets.
export const MarkdownKit = [
  MarkdownPlugin.configure({ initialState: { remarkPlugins: [remarkGfm] } }),
];

// Bad: package hook exists only to feed one shadcn component's local UI.
const state = useSingleComponentOnlyState();
return <Popover open={state.open}>...</Popover>;

// Bad: React-only package hook that mainly returns renderer glue.
const { dialogTitle, menuItems, onOpenChange, popoverOpen } =
  useToolbarMenuState();

Workflow

  1. Start with the shadcn skill. Run the normal shadcn docs/search workflow first.
  2. Search Plate for the closest analog in

apps/www/src/registry/components/editor, the applicable

apps/www/src/registry/bases/* variant, and the relevant packages/*.

  1. Decide ownership before writing code: package ownership requires a durable

contract independent of the renderer (docs/vision/plate.md).

  1. Decide the three layers before coding:
  1. Choose the component-family shape before writing state/effects:
  1. Apply the React checks before writing state/effects:
  1. Build the component as open code first.
  2. When plugin wiring changes, audit the affected field and its registry peers

for local structural mirrors, state Pick aliases, callback return

annotations, and casts that replace package ownership or contextual

inference. Fix the canonical package contract instead of preserving a local

adapter.

  1. Extract only the boundaries that pass that ownership test.
  2. Share runtime-neutral kits; wire base/live renderer kits and registry deps

only where the renderer ownership actually differs.

Audit References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.