View as Markdown

API reference: @salmonui/rich-text

RichTextMentionsinterface

import type { RichTextMentions } from '@salmonui/rich-text';
interface RichTextMentions<T = MentionItem> {
    readonly trigger?: string;
    readonly items?: readonly T[];
    readonly onSearch?: (text: string) => Promise<readonly T[]>;
    readonly renderItem?: (context: MentionRenderItemContext<T>) => ReactNode;
    readonly mentionProps?: Omit<MentionProps<T>, 'editor' | 'children' | 'target' | 'data' | 'triggers' | 'renderItem'>;
}
RichTextMentions members (5)
NameSignatureDescription
triggeroptionalreadonly trigger?: string;

Trigger character (default '@').

itemsoptionalreadonly items?: readonly T[];
onSearchoptionalreadonly onSearch?: (text: string) => Promise<readonly T[]>;

Remote suggestions for the typed text.

renderItemoptionalreadonly renderItem?: (context: MentionRenderItemContext<T>) => ReactNode;
mentionPropsoptionalreadonly mentionProps?: Omit<MentionProps<T>, 'editor' | 'children' | 'target' | 'data' | 'triggers' | 'renderItem'>;

Further Mention props (labels, search options, events).