View as Markdown

API reference: @salmonui/rich-text

ContentEditableMentionOptionsinterface

import type { ContentEditableMentionOptions } from '@salmonui/rich-text';
interface ContentEditableMentionOptions {
    readonly chipClassName?: string;
    readonly spacer?: string;
    readonly createChip?: (insertion: MentionEditorInsertion, doc: Document) => HTMLElement;
}
ContentEditableMentionOptions members (3)
NameSignatureDescription
chipClassNameoptionalreadonly chipClassName?: string;

Class of the inserted chip (default 'salmon-mention-chip').

spaceroptionalreadonly spacer?: string;

Text placed after a chip when the trigger has no suffix, so the caret has a place to sit (default a no-break space).

createChipoptionalreadonly createChip?: (insertion: MentionEditorInsertion, doc: Document) => HTMLElement;

Builds the chip; the default is a <span contenteditable="false"> with data-mention-* attributes.