# BlockEditorProps (@salmonui/rich-text)

> The BlockEditorProps interface of @salmonui/rich-text.

Canonical: https://salmonui.dev/docs/reference/rich-text/BlockEditorProps

```ts
import type { BlockEditorProps } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: interface

```ts
interface BlockEditorProps {
    readonly value?: readonly Block[];
    readonly defaultValue?: readonly Block[];
    readonly onChange?: (blocks: Block[]) => void;
    readonly onBlockChange?: (event: BlockEditorBlockChangeEvent) => void;
    readonly onSelectionChange?: (selection: BlockEditorSelection | null) => void;
    readonly onFocus?: () => void;
    readonly onBlur?: () => void;
    readonly readOnly?: boolean;
    readonly placeholder?: string;
    readonly slashMenu?: false | readonly BlockEditorSlashItem[];
    readonly inlineToolbar?: false | readonly BlockEditorInlineToolbarItem[];
    readonly transforms?: readonly BlockEditorTransformId[];
    readonly blockActions?: readonly BlockEditorBlockAction[];
    readonly contextMenu?: false | readonly BlockEditorContextMenuItem[];
    readonly draggable?: boolean;
    readonly onBeforeBlockMove?: (event: BlockEditorBeforeBlockMoveEvent) => void;
    readonly onBlockMove?: (event: BlockEditorBlockMoveEvent) => void;
    readonly onUpload?: (file: File) => Promise<{
        readonly src: string;
        readonly alt?: string;
    }>;
    readonly codeLanguages?: readonly {
        readonly value: string;
        readonly label: string;
    }[];
    readonly highlight?: HighlightFn;
    readonly pasteCleanup?: Omit<PasteCleanupOptions, 'embedHosts' | 'sanitize'>;
    readonly onBeforePaste?: (event: BlockEditorBeforePasteEvent) => void;
    readonly onPaste?: (event: BlockEditorPasteEvent) => void;
    readonly undoLimit?: number;
    readonly keyBindings?: Readonly<Partial<Record<BlockEditorCommandId, string | false>>>;
    readonly mentions?: BlockEditorMentions;
    readonly labels?: BlockEditorLabels;
    readonly extensions?: readonly RichTextExtension[];
    readonly embedHosts?: readonly string[];
    readonly sanitize?: SanitizeHook;
    readonly localeText?: Partial<BlockEditorLocaleText>;
    readonly 'aria-label'?: string;
    readonly 'aria-labelledby'?: string;
    readonly id?: string;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly actionsRef?: Ref<BlockEditorActions | null>;
}
```

Members (37):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: readonly Block[];` | optional | Controlled document. Pass back what `onChange` gave to keep the editor in sync. |
| `defaultValue` | `readonly defaultValue?: readonly Block[];` | optional |  |
| `onChange` | `readonly onChange?: (blocks: Block[]) => void;` | optional |  |
| `onBlockChange` | `readonly onBlockChange?: (event: BlockEditorBlockChangeEvent) => void;` | optional |  |
| `onSelectionChange` | `readonly onSelectionChange?: (selection: BlockEditorSelection \| null) => void;` | optional |  |
| `onFocus` | `readonly onFocus?: () => void;` | optional |  |
| `onBlur` | `readonly onBlur?: () => void;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `placeholder` | `readonly placeholder?: string;` | optional | Shown in an empty document. |
| `slashMenu` | `readonly slashMenu?: false \| readonly BlockEditorSlashItem[];` | optional | Slash menu entries (default: every built-in); `false` turns the menu off. |
| `inlineToolbar` | `readonly inlineToolbar?: false \| readonly BlockEditorInlineToolbarItem[];` | optional | Selection toolbar entries (default bold, italic, underline, strike, code, link, turnInto); `false` hides it. |
| `transforms` | `readonly transforms?: readonly BlockEditorTransformId[];` | optional | Types offered by `'turnInto'` (default: all). |
| `blockActions` | `readonly blockActions?: readonly BlockEditorBlockAction[];` | optional | Block action menu entries (default duplicate, delete, moveUp, moveDown, turnInto). |
| `contextMenu` | `readonly contextMenu?: false \| readonly BlockEditorContextMenuItem[];` | optional | Context menu entries (default: all built-in); `false` keeps the browser menu. |
| `draggable` | `readonly draggable?: boolean;` | optional | Drag handles reorder and nest blocks (default true). |
| `onBeforeBlockMove` | `readonly onBeforeBlockMove?: (event: BlockEditorBeforeBlockMoveEvent) => void;` | optional |  |
| `onBlockMove` | `readonly onBlockMove?: (event: BlockEditorBlockMoveEvent) => void;` | optional |  |
| `onUpload` | `readonly onUpload?: (file: File) => Promise<{     readonly src: string;     readonly alt?: string; }>;` | optional | Uploads an image, audio or video file; the block is pending until it settles. Default: a blob URL. |
| `codeLanguages` | `readonly codeLanguages?: readonly {     readonly value: string;     readonly label: string; }[];` | optional | Code block languages. |
| `highlight` | `readonly highlight?: HighlightFn;` | optional | Code highlighting hook. |
| `pasteCleanup` | `readonly pasteCleanup?: Omit<PasteCleanupOptions, 'embedHosts' \| 'sanitize'>;` | optional | Paste cleanup. Default mode `'clean'`. |
| `onBeforePaste` | `readonly onBeforePaste?: (event: BlockEditorBeforePasteEvent) => void;` | optional |  |
| `onPaste` | `readonly onPaste?: (event: BlockEditorPasteEvent) => void;` | optional |  |
| `undoLimit` | `readonly undoLimit?: number;` | optional | Undo steps kept (default 30). |
| `keyBindings` | `readonly keyBindings?: Readonly<Partial<Record<BlockEditorCommandId, string \| false>>>;` | optional | Command id -> key chord (ProseMirror key names, `Mod-` = Ctrl/Cmd); `false` removes the default. |
| `mentions` | `readonly mentions?: BlockEditorMentions;` | optional |  |
| `labels` | `readonly labels?: BlockEditorLabels;` | optional |  |
| `extensions` | `readonly extensions?: readonly RichTextExtension[];` | optional | Engine extensions, for example `createCollaboration()` from `/collab`. Keep the array stable. |
| `embedHosts` | `readonly embedHosts?: readonly string[];` | optional | Hosts whose iframe embeds are kept by the sanitizer. |
| `sanitize` | `readonly sanitize?: SanitizeHook;` | optional | Further sanitizer restriction. Keep it stable. |
| `localeText` | `readonly localeText?: Partial<BlockEditorLocaleText>;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string;` | optional |  |
| `id` | `readonly id?: string;` | optional |  |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |
| `actionsRef` | `readonly actionsRef?: Ref<BlockEditorActions \| null>;` | optional |  |
