Skip to content

Vizel API / react/src / createVizelMentionMenuRenderer

Function: createVizelMentionMenuRenderer()

ts
function createVizelMentionMenuRenderer(options?): Partial<SuggestionOptions<VizelMentionItem>>;

Defined in: packages/react/src/hooks/createVizelMentionMenuRenderer.ts:33

Creates a suggestion render configuration for the Mention extension. This handles the popup positioning and React component lifecycle.

Parameters

ParameterType
optionsVizelSuggestionRendererOptions

Returns

Partial&lt;SuggestionOptions&lt;VizelMentionItem&gt;&gt;

Example

tsx
import { createVizelMentionMenuRenderer } from '@vizel/react';

const editor = useVizelEditor({
  features: {
    interaction: {
      mention: {
        items: async (query) => fetchUsers(query),
        suggestion: createVizelMentionMenuRenderer(),
      },
    },
  },
});

Released under the MIT License.