Back to Plate

Basic Elements

content/(plugins)/(elements)/basic-blocks.mdx

53.0.52.0 KB
Original Source
<Cards> <Card icon="heading" title="Heading" href="/docs/heading"> Create headings of various levels to structure content. </Card> <Card icon="blockquote" title="Blockquote" href="/docs/blockquote"> Emphasize important information with styled quotes. </Card> <Card icon="horizontal-rule" title="Horizontal Rule" href="/docs/horizontal-rule"> Insert horizontal lines to separate content. </Card> </Cards> <ComponentPreview name="basic-blocks-demo" />

Kit Usage

<Steps>

Installation

The BasicBlocksKit bundles plugins for Paragraphs, Headings (H1, H2, H3), Blockquotes, and Horizontal Rules, along with their respective UI components from Plate UI. It also registers the shipped markdown input rules for headings, blockquotes, and horizontal rules.

<ComponentSource name="basic-blocks-kit" />

Add Kit

Add the kit to your plugins:

tsx
import { createPlateEditor } from 'platejs/react';
import { BasicBlocksKit } from '@/components/editor/plugins/basic-blocks-kit';

const editor = createPlateEditor({
  plugins: [
    // ...otherPlugins,
    ...BasicBlocksKit,
  ],
});
</Steps>

The kit enables the common block markdown shortcuts out of the box:

  • # , ## , ### for headings
  • > for blockquotes
  • --- and ___ for horizontal rules

See the Plugin Input Rules guide for the runtime model and the exact rule families.

Manual Usage

bash
npm install @platejs/basic-nodes

For individual plugin setup and configuration, see the specific plugin documentation pages linked above.