Docs
AI

AI

allows you to select from a list of AI commands.

Features

  • Provides an AI-powered menu.
  • Offers a selection of AI commands to enhance content creation and editing.
  • Seamlessly integrates AI assistance within the editor interface.

Installation

npm install @udecode/plate-ai

Usage

// ...
import { AIPlugin } from '@/registry/default/plate-pro/ai/ai/src/react/AIPlugin';
 
const editor = usePlateEditor({
  id: 'ai-demo',
  override: {
    components: PlateUI,
  },
  plugins: [
    ...commonPlugins,
    SelectionOverlayPlugin,
    MarkdownPlugin.configure({ options: { indentList: true } }),
    AIPlugin.configure({
      options: {
        scrollContainerSelector: '#scroll_container',
      },
      render: { aboveEditable: AIMenu },
    }),
  ],
  value: aiValue,
});

Plugins

AlignPlugin

API

setAlign

Sets the alignment for the specified block elements in the editor.

Parameters

Collapse all

    The editor instance.

API Components

useAlignDropdownMenuState

Returns

Collapse all

    The alignment value.

useAlignDropdownMenu

State

Collapse all

    The alignment value.

Returns

Collapse all

    Props for the radio group.