Basic Marks

Set of essential text formatting options.

Marks

Add style and emphasis to your text using the mark plugins, which offers a variety of formatting options.
Make text bold, italic, underlined, or apply a combination of these styles for a visually striking effect.
Add strikethrough to indicate deleted or outdated content.
Write code snippets with inline code formatting for easy readability.
Files
components/demo.tsx
'use client';

import React from 'react';

import { Plate } from '@udecode/plate-common/react';

import { editorPlugins } from '@/components/editor/plugins/editor-plugins';
import { useCreateEditor } from '@/components/editor/use-create-editor';
import { Editor, EditorContainer } from '@/components/plate-ui/editor';

import { DEMO_VALUES } from './values/demo-values';

export default function Demo({ id }: { id: string }) {
  const editor = useCreateEditor({
    plugins: [...editorPlugins],
    value: DEMO_VALUES[id],
  });

  return (
    <Plate editor={editor}>
      <EditorContainer variant="demo">
        <Editor />
      </EditorContainer>
    </Plate>
  );
}

Features

  • Includes commonly used text styling features: bold, italic, underline, strikethrough, subscript, superscript, and code.

Plugins:

  • BoldPlugin for bold mark
  • ItalicPlugin for italic mark
  • UnderlinePlugin for underline mark
  • StrikethroughPlugin for strikethrough mark
  • SubscriptPlugin for subscript mark
  • SuperscriptPlugin for superscript mark
  • CodePlugin for code mark

Installation

npm install @udecode/plate-basic-marks

Usage

import { BasicMarksPlugin } from '@udecode/plate-basic-marks/react';
 
const plugins = [
  // ...otherPlugins,
  BasicMarksPlugin,
];

Keyboard Shortcuts

KeyDescription
Cmd + B

Toggle the bold formatting for the selected text.

Cmd + I

Toggle the italic formatting for the selected text.

Cmd + U

Toggle the underline formatting for the selected text.

Cmd + E

Toggle the code formatting for the selected text.

Cmd + Shift + X

Toggle the strikethrough formatting for the selected text.

Cmd + ,

Toggle the subscript formatting for the selected text.

Cmd + .

Toggle the superscript formatting for the selected text.

Plugins

BasicMarksPlugin

BoldPlugin

Options

Collapse all

    Node properties to delete.

CodePlugin

Options

Collapse all

    Node properties to delete.

ItalicPlugin

Options

Collapse all

    Node properties to delete.

UnderlinePlugin

Options

Collapse all

    Node properties to delete.

StrikethroughPlugin

Options

Collapse all

    Node properties to delete.

SubscriptPlugin

Options

Collapse all

    Node properties to delete.

SuperscriptPlugin

Options

Collapse all

    Node properties to delete.