API reference

Single reference for components, hooks, extension, and utilities. Use the table of contents to jump to a section.

Compound components

SuggestMenu

Root. Pass editor + trigger options (simple API), or menu (the composable instance returned by useSuggestMenu) for composable usage. All props documented in types.

SuggestMenu.Portal

Renders children into a portal outside the editor DOM.

SuggestMenu.Positioner

Positions the popup relative to the cursor (Base UI Popover). Props: side, align, sideOffset, collision handling.

SuggestMenu.Popup

Popup container. Receives data-empty when no items match.

SuggestMenu.List

Listbox container. Wires keyboard navigation via internal getListProps. A function child is shorthand for rendering the top-level collection.

SuggestMenu.Group

Groups items with role="group".

SuggestMenu.GroupLabel

Label element for a group (e.g. “People”, “Commands”).

SuggestMenu.Item

Single listbox option. Accepts value and optional index. Keyboard and mouse are wired internally.

SuggestMenu.Collection

Renders the current collection with no wrapper. Inside SuggestMenu.Group, it renders that group's items.

SuggestMenu.Empty

Rendered when the filtered list is empty. Flexible inside or outside the list; outside is the recommended default.

SuggestMenu.Dismiss

Generic dismiss action primitive for freeform actions such as buttons outside the list.

SuggestMenu.DismissItem

Selectable fallback row that dismisses the menu from inside the listbox.

Hooks

useSuggestMenu(editor, options)

Returns the composable menu instance used by the Root menu prop. It includes state, items, select, dismiss, and softDismiss, plus the internal keyboard wiring needed by the composable API.

useListKeyboard(options)

Standalone keyboard navigation for fully custom list UIs. Returns getListProps, getItemProps, handleKeyDown, highlightedIndex.

SuggestMenu.useContext()

Read SuggestMenuContext from any child inside a SuggestMenu tree.

Extension

SuggestMenuExtension.configure({ pills })

Returns a Tiptap extension. pills is an array of InlineNodeConfig (name, group, attributes, etc.) to register inline node schemas for pill/chip insertion.

Utilities

createFilter(filterOptions?)

Fuse.js-based filter factory. Optional Fuse options.

createInlineNode(config)

Node extension factory for custom inline nodes (pills).

Types

Key types exported from the package. See .d.ts or IDE hover for full shapes.

  • SuggestionItem, SuggestionGroup, SuggestionEntry
  • SuggestState, SuggestFilterOptions, SuggestFilterResult
  • InlineNodeConfig
  • SuggestBeforeSelectContext, SuggestSelectContext, SuggestSessionContext, SuggestMenuKeyDownContext