Typix LogoTypix
Extensions

Mention

@-mention picker with custom trigger + suggestion source

Watches for a trigger character (default @) and opens a typeahead picker to insert mention nodes. Works for people, channels, anything suggestion-shaped.

Install

pnpm add @typix-editor/extension-mention

Live demo

Config

OptionTypeDefaultDescription
triggerstring"@"The character that opens the picker.
searchMentionSearchFnsyncAsync/sync function returning MentionItem[].
nodeMentionNodeOptionsCustomize the mention node renderer.
import type { MentionSearchFn } from "@typix-editor/extension-mention";

const searchUsers: MentionSearchFn = async (query) => {
  const res = await fetch(`/api/users?q=${query}`);
  const users = await res.json();
  return users.map((u) => ({
    id: u.id,
    label: u.name,
    subtitle: u.email,
    avatar: u.avatar,
  }));
};

configExtension(MentionExtension, { trigger: "@", search: searchUsers });

Custom trigger (e.g., #channels)

configExtension(MentionExtension, {
  trigger: "#",
  search: searchChannels,
});

Add multiple instances for multiple triggers (e.g., @users + #channels).

Vendor the UI

npx typix ui add mention

On this page