Skip to Content
Navigation & Menus@hacline/ui/trigger-menu

TriggerMenu

Open inline suggestions at the text caret when specific characters are typed.

Usage

Type @ to filter collaborators and press Enter to insert a mention. Each entry in triggers configures its trigger character and candidate list.

Line-Start Slash Commands

Type / at the start of a line to open Markdown suggestions and generate formatted text via insert.

Parts

PartDescription
TriggerMenuContent
The popup that holds the suggestions, anchored at the caret.
TriggerMenuEmpty
Shown while no item matches. Rendering it keeps the menu open with no matches; without it, the menu closes until something matches.
TriggerMenuGroup
A group of items, named by its TriggerMenuGroupLabel.
TriggerMenuGroupLabel
The group's heading, which names the group.
TriggerMenuHint
Ghost text at the caret for the arguments still to type, like <name>. Without children, the hints.
TriggerMenuInput
The text field the menu suggests into: a <textarea>, or an <input> through render.
TriggerMenuItem
A suggestion. Choosing it inserts it into the text.
TriggerMenuItemIcon
An icon inside a suggestion. Screen readers, typeahead and filtering skip it, and mirror flips it in right-to-left text.
TriggerMenuItems
Renders data items. Used by data menus, and available for custom layouts.
TriggerMenuList
The listbox. Without children, it renders the current trigger's items, filtered.
TriggerMenuSeparator
A line between items or groups, hidden from screen readers.
TriggerMenuStatus
A polite status, outside the popup. Without children, it says the count and the keys once typing pauses.

Props

Prop

Type

View UI SDK parts and state attributes.