# Composer Trigger Hooks URL: /docs/api-reference/hooks/composer-triggers Unstable assistant-ui hooks for mention menus, slash commands, and custom composer trigger popovers. {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */} {/* Do not edit manually. */} {/* api-reference:start */} {/* AUTO-GENERATED by scripts/generate-api-reference.mts */} {/* Do not edit this block manually. */} ## API Reference \[#api-reference] ### unstable\_useTriggerPopoverRootContext \[#unstable\_usetriggerpopoverrootcontext] ```ts const unstable_useTriggerPopoverRootContext: () => TriggerPopoverRootContextValue; ``` ### unstable\_useTriggerPopoverRootContextOptional \[#unstable\_usetriggerpopoverrootcontextoptional] ```ts const unstable_useTriggerPopoverRootContextOptional: () => TriggerPopoverRootContextValue | null; ``` ### unstable\_useTriggerPopoverScopeContext \[#unstable\_usetriggerpopoverscopecontext] ```ts const unstable_useTriggerPopoverScopeContext: () => TriggerPopoverResourceOutput; ``` ### unstable\_useTriggerPopoverScopeContextOptional \[#unstable\_usetriggerpopoverscopecontextoptional] ```ts const unstable_useTriggerPopoverScopeContextOptional: () => TriggerPopoverResourceOutput | null; ``` ### unstable\_useTriggerPopoverTriggers \[#unstable\_usetriggerpopovertriggers] Live map of registered triggers, re-rendering on change. Prefer `subscribeLifecycle` for incremental add/remove handling. ```ts const unstable_useTriggerPopoverTriggers: () => ReadonlyMap; ``` ### unstable\_useTriggerPopoverTriggersOptional \[#unstable\_usetriggerpopovertriggersoptional] Like `useTriggerPopoverTriggers` but returns an empty map outside a root. ```ts const unstable_useTriggerPopoverTriggersOptional: () => ReadonlyMap; ``` ### unstable\_useMentionAdapter \[#unstable\_usementionadapter] Deprecated: Under active development and might change without notice. Creates a spreadable `{ adapter, directive }` bundle for `@` mentions. Supports tools registered via `useAssistantTool`, explicit items, or both — flat or categorized. ### unstable\_useSlashCommandAdapter \[#unstable\_useslashcommandadapter] Deprecated: Under active development and may change without notice. Bundles slash command definitions (with inline `execute` callbacks) into `{adapter, action}` that plug directly into `ComposerTriggerPopover`. `execute` stays in the hook closure and is never attached to the returned `TriggerItem`, keeping items serializable. {/* api-reference:end */}