# RichTextEditorProps (@salmonui/rich-text)

> The RichTextEditorProps interface of @salmonui/rich-text: TMention is the item type of mentions (its renderItem receives it).

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

```ts
import type { RichTextEditorProps } 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 RichTextEditorProps<TMention = MentionItem> {
    readonly value?: string;
    readonly defaultValue?: string;
    readonly onChange?: (html: string) => void;
    readonly changeDelay?: number;
    readonly onBlur?: (html: string) => void;
    readonly onFocus?: () => void;
    readonly toolbar?: readonly RichTextToolbarItem[] | 'floating' | false;
    readonly toolbarOverflow?: 'menu' | 'scroll' | 'wrap';
    readonly toolbarPosition?: 'top' | 'bottom';
    readonly stickyToolbar?: boolean;
    readonly quickToolbars?: RichTextQuickToolbars | false;
    readonly fontFamilies?: readonly {
        readonly label: string;
        readonly value: string;
    }[];
    readonly fontSizes?: readonly string[];
    readonly colors?: readonly {
        readonly label: string;
        readonly value: string;
    }[];
    readonly onUpload?: UploadHandler;
    readonly imageInsert?: 'base64' | 'blob';
    readonly onUploadError?: (error: unknown, file: File) => void;
    readonly embedHosts?: readonly string[];
    readonly codeLanguages?: readonly (string | {
        readonly value: string;
        readonly label: string;
    })[];
    readonly highlight?: HighlightFn;
    readonly pasteCleanup?: RichTextPasteCleanup;
    readonly sanitize?: SanitizeHook;
    readonly onImport?: (file: File) => Promise<string>;
    readonly importAccept?: string;
    readonly onBrowseFiles?: (kind: 'image' | 'audio' | 'video') => Promise<{
        readonly src: string;
        readonly alt?: string;
    } | null>;
    readonly aiAssistant?: RichTextAiAssistant;
    readonly emojiList?: readonly RichTextEmoji[];
    readonly slashMenu?: boolean | readonly RichTextSlashItem[];
    readonly mentions?: RichTextMentions<TMention>;
    readonly undoLimit?: number;
    readonly undoGroupDelay?: number;
    readonly showCount?: boolean;
    readonly maxLength?: number;
    readonly resizable?: boolean;
    readonly fullscreen?: boolean;
    readonly defaultFullscreen?: boolean;
    readonly onFullscreenChange?: (fullscreen: boolean) => void;
    readonly enterKey?: 'p' | 'div' | 'br';
    readonly shiftEnterKey?: 'p' | 'div' | 'br';
    readonly tabKey?: 'indent' | 'focus';
    readonly keyBindings?: RichTextKeyBindings;
    readonly extensions?: readonly RichTextExtension[];
    readonly placeholder?: string;
    readonly readOnly?: boolean;
    readonly disabled?: boolean;
    readonly name?: string;
    readonly required?: boolean;
    readonly invalid?: boolean;
    readonly localeText?: Partial<RichTextEditorLocaleText>;
    readonly actionsRef?: RefObject<RichTextEditorActions | null> | Ref<RichTextEditorActions>;
    readonly onReady?: (actions: RichTextEditorActions) => void;
    readonly onBeforeCommand?: (event: RichTextBeforeCommandEvent) => void;
    readonly onCommand?: (event: RichTextCommandEvent) => void;
    readonly onToolbarItemClick?: (event: RichTextToolbarItemClickEvent) => void;
    readonly onBeforeDialogOpen?: (event: RichTextBeforeDialogOpenEvent) => void;
    readonly onDialogClose?: (event: {
        readonly dialog: RichTextDialogId;
    }) => void;
    readonly onBeforePopupOpen?: (event: RichTextBeforePopupOpenEvent) => void;
    readonly onToolbarStateChange?: (state: RichTextToolbarState) => void;
    readonly id?: string;
    readonly 'aria-label'?: string;
    readonly 'aria-labelledby'?: string;
    readonly 'aria-describedby'?: string;
    readonly className?: string;
    readonly style?: CSSProperties;
}
```

`TMention` is the item type of `mentions` (its `renderItem` receives it).

Members (64):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: string;` | optional |  |
| `defaultValue` | `readonly defaultValue?: string;` | optional |  |
| `onChange` | `readonly onChange?: (html: string) => void;` | optional | The HTML value after a transaction batch (`changeDelay` ms, default 0: once per batch). |
| `changeDelay` | `readonly changeDelay?: number;` | optional |  |
| `onBlur` | `readonly onBlur?: (html: string) => void;` | optional |  |
| `onFocus` | `readonly onFocus?: () => void;` | optional |  |
| `toolbar` | `readonly toolbar?: readonly RichTextToolbarItem[] \| 'floating' \| false;` | optional |  |
| `toolbarOverflow` | `readonly toolbarOverflow?: 'menu' \| 'scroll' \| 'wrap';` | optional |  |
| `toolbarPosition` | `readonly toolbarPosition?: 'top' \| 'bottom';` | optional |  |
| `stickyToolbar` | `readonly stickyToolbar?: boolean;` | optional |  |
| `quickToolbars` | `readonly quickToolbars?: RichTextQuickToolbars \| false;` | optional |  |
| `fontFamilies` | `readonly fontFamilies?: readonly {     readonly label: string;     readonly value: string; }[];` | optional |  |
| `fontSizes` | `readonly fontSizes?: readonly string[];` | optional |  |
| `colors` | `readonly colors?: readonly {     readonly label: string;     readonly value: string; }[];` | optional |  |
| `onUpload` | `readonly onUpload?: UploadHandler;` | optional | Image, audio and video upload (pending until the promise settles). |
| `imageInsert` | `readonly imageInsert?: 'base64' \| 'blob';` | optional | Without `onUpload`: inline images as data URLs or object URLs (default `'blob'`). |
| `onUploadError` | `readonly onUploadError?: (error: unknown, file: File) => void;` | optional |  |
| `embedHosts` | `readonly embedHosts?: readonly string[];` | optional |  |
| `codeLanguages` | `readonly codeLanguages?: readonly (string \| {     readonly value: string;     readonly label: string; })[];` | optional |  |
| `highlight` | `readonly highlight?: HighlightFn;` | optional |  |
| `pasteCleanup` | `readonly pasteCleanup?: RichTextPasteCleanup;` | optional |  |
| `sanitize` | `readonly sanitize?: SanitizeHook;` | optional |  |
| `onImport` | `readonly onImport?: (file: File) => Promise<string>;` | optional |  |
| `importAccept` | `readonly importAccept?: string;` | optional |  |
| `onBrowseFiles` | `readonly onBrowseFiles?: (kind: 'image' \| 'audio' \| 'video') => Promise<{     readonly src: string;     readonly alt?: string; } \| null>;` | optional |  |
| `aiAssistant` | `readonly aiAssistant?: RichTextAiAssistant;` | optional |  |
| `emojiList` | `readonly emojiList?: readonly RichTextEmoji[];` | optional |  |
| `slashMenu` | `readonly slashMenu?: boolean \| readonly RichTextSlashItem[];` | optional |  |
| `mentions` | `readonly mentions?: RichTextMentions<TMention>;` | optional |  |
| `undoLimit` | `readonly undoLimit?: number;` | optional |  |
| `undoGroupDelay` | `readonly undoGroupDelay?: number;` | optional |  |
| `showCount` | `readonly showCount?: boolean;` | optional |  |
| `maxLength` | `readonly maxLength?: number;` | optional |  |
| `resizable` | `readonly resizable?: boolean;` | optional |  |
| `fullscreen` | `readonly fullscreen?: boolean;` | optional |  |
| `defaultFullscreen` | `readonly defaultFullscreen?: boolean;` | optional |  |
| `onFullscreenChange` | `readonly onFullscreenChange?: (fullscreen: boolean) => void;` | optional |  |
| `enterKey` | `readonly enterKey?: 'p' \| 'div' \| 'br';` | optional |  |
| `shiftEnterKey` | `readonly shiftEnterKey?: 'p' \| 'div' \| 'br';` | optional |  |
| `tabKey` | `readonly tabKey?: 'indent' \| 'focus';` | optional |  |
| `keyBindings` | `readonly keyBindings?: RichTextKeyBindings;` | optional |  |
| `extensions` | `readonly extensions?: readonly RichTextExtension[];` | optional |  |
| `placeholder` | `readonly placeholder?: string;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `name` | `readonly name?: string;` | optional |  |
| `required` | `readonly required?: boolean;` | optional |  |
| `invalid` | `readonly invalid?: boolean;` | optional |  |
| `localeText` | `readonly localeText?: Partial<RichTextEditorLocaleText>;` | optional |  |
| `actionsRef` | `readonly actionsRef?: RefObject<RichTextEditorActions \| null> \| Ref<RichTextEditorActions>;` | optional |  |
| `onReady` | `readonly onReady?: (actions: RichTextEditorActions) => void;` | optional |  |
| `onBeforeCommand` | `readonly onBeforeCommand?: (event: RichTextBeforeCommandEvent) => void;` | optional |  |
| `onCommand` | `readonly onCommand?: (event: RichTextCommandEvent) => void;` | optional |  |
| `onToolbarItemClick` | `readonly onToolbarItemClick?: (event: RichTextToolbarItemClickEvent) => void;` | optional |  |
| `onBeforeDialogOpen` | `readonly onBeforeDialogOpen?: (event: RichTextBeforeDialogOpenEvent) => void;` | optional |  |
| `onDialogClose` | `readonly onDialogClose?: (event: {     readonly dialog: RichTextDialogId; }) => void;` | optional |  |
| `onBeforePopupOpen` | `readonly onBeforePopupOpen?: (event: RichTextBeforePopupOpenEvent) => void;` | optional |  |
| `onToolbarStateChange` | `readonly onToolbarStateChange?: (state: RichTextToolbarState) => void;` | optional |  |
| `id` | `readonly id?: string;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string;` | optional |  |
| `aria-describedby` | `readonly 'aria-describedby'?: string;` | optional |  |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |
