Skip to content
Back

Mention inputPro

Type @ to mention people, files and agents or / for commands: ranked, grouped suggestions at the caret, keyboard picking, and pills for accepted mentions.

oxyn add mention-input
1 suggestions
MMaya ChenBackend lead
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Power users drive agents from the keyboard. / runs commands (/plan, /review, /model), @ pulls context in (files, folders, symbols, previous threads, URLs, people) or calls an agent or app, $ picks a skill ("@ files, $ skills, / commands" [R003]) and # adds context or steering rules (Kiro uses # for steering, research notes 03).
  • The popover must be fast, forgiving (fuzzy), honest about async search (loading, empty, error), and once something is picked, the text area must show it as a solid token the user can trust, hover, and delete as one unit.
  • Research found two meanings of a mention, attach context versus force a tool (research notes 04: Gemini @Gmail, Raycast @extension versus Dia and Notion page mentions); the library must make that difference visible.

When not to use

  • Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
  • The model menu of an AI chat: use Model Picker instead.
  • The prompt box for an agent, in six layouts: use Composer instead.

Installation

Mention input is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add mention-input

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Mention

@ suggestions grouped by kind.

1 suggestions
MMaya ChenBackend lead
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Commands

/ commands at the line start.

5 suggestions
//reviewReview the open diff
//testRun the test suite
//planPlan before editing
//compactSummarise the context
//clearStart a new thread
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Pills

Accepted mentions render as pills.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Upward

Opens above, for a bottom composer.

1 suggestions
MMaya ChenBackend lead
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

MentionInput

PropTypeDefaultDescription
suggestionsrequiredVec<Suggestion>—`@` suggestions.
commandsVec<Suggestion>Default::default()`/` commands.
valueStringDefault::default()Initial text.
limitusize6Max rows in the list.
placeholderString"Message, @ to mention, / for commands"Placeholder.
upbooltrueOpens upward (composer at the bottom).
on_submitEventHandler<String>—Submitted text.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
↑or↓Move through suggestions
EnterorTabInsert the suggestion
EscapeClose the list
EnterSend when the list is closed

Accessibility

  • The field is a combobox with aria-activedescendant on the open listbox.
  • Options carry aria-selected; a polite region announces the result count.
From the spec
  • The text area is the combobox: aria-expanded, aria-controls → listbox, aria-activedescendant → highlighted option. Focus never leaves the text area while the popover is open.
  • Options: role=option with aria-selected, grouped in labelled groups; disabled options use aria-disabled and keep their reason in the accessible description.
  • Polite live region announces result counts ("12 results, Files"), "No results", "Loading files", errors, and acceptance ("Inserted mention auth.rs", "Command plan added. Argument: branch").
  • Tokens are exposed inline as text with a role description, e.g. "mention, file auth.rs" or "tool, Gmail, will run"; the kind is spoken, not only styled.
  • Hover cards are reachable by keyboard focus on the token and dismissible with Esc.
  • Contrast: token label 4.5:1 against its fill; matched-character emphasis uses weight, not colour; kind distinctions use icon + outline style + text.
  • Focus order is unchanged by the popover; Esc always returns to plain typing.
  • Reduced motion per §5.

Motion & interaction

  • Open. Popover appears above the caret (below if no room), anchored to the trigger char's x position, scaling from 0.98 with a 4 px rise and fade. The trigger char gets a faint underline while the popover is open, so the user sees what is being completed.
  • Loading. Stale results dim instead of disappearing (no layout flash); skeleton only when nothing is cached and the wait exceeds 120 ms.
  • Filtering. Rows re-order with a short glide when the move is small and snap when it is a long jump ; the highlight glides on a snappy spring; the panel height springs to fit.
  • Match highlight. Matched characters render in medium weight (not colour) as the user types.
  • Accept. The highlighted row's label flies from the popover into the caret position and lands as the token chip (shared-element, 200 ms); the popover fades out at the same time. Reduced motion: the token appears in place.
  • Mode command shimmer. A mode token (/plan) gets a single 900 ms ease-out light sweep as it lands (MonoCode's composer mode shimmer, MIT, research notes 08).
  • Arg hint. Ghost text fades in after the token; each filled argument becomes a sub-chip inside the command token (inline argument fields, a pattern seen in Paradev, research notes 03).
  • Backspace. First press rings the token (selected), second press shrinks it to 0.9 and fades it out; the following text slides left to close the gap.
  • Broken token. When its target disappears, the label strikes through over 200 ms and a warning icon fades in; no popup.
  • Hover card. Appears after 300 ms hover or immediately on keyboard focus; stays while the pointer moves into it.
  • Tabs. Switching tabs (All · Files · Symbols · Threads · Skills…) slides the list 12 px in the direction of travel and cross-fades (tabbed @ popup idea from Codex CLI, research notes 03).
Timing
TransitionDurationDelayEasing / springNotes
Popover open (scale 0.98→1, y 4→0, fade)140 ms0ease-out cubic-bezier(0.22, 1, 0.36, 1)proposed
Popover close100 ms0ease-in
Local source debounce—0–30 ms—in-memory lists filter every keystroke
Remote source debounce—120 ms—cancel in-flight on new key
Skeleton appears—120 ms—never flashes for fast sources
Stale-results dim100 ms0linear100 % → 60 %
Row reorder glide140 ms0spring (stiffness 500, damping 40, proposed)snap when moving > 6 rows
Highlight glide120 ms0spring (stiffness 600, damping 40, proposed)
Panel height160 ms0spring, no overshoot
Accept fly-in to caret200 ms0ease-in-outshared element
Mode token shimmer900 ms, one sweepon insertease-outMonoCode, MIT
Arg ghost text120 ms60 msease-out
Token selected ring80 ms0ease-out
Token remove120 ms + 140 ms text close0ease-in / spring
Hover card140 ms300 ms (0 on focus)ease-out
Tab switch160 ms0ease-out, 12 px
Broken strike-through200 ms0ease-out
Request timeout → Error—8 s (proposed)—
Reduced motion0–80 ms opacity cross-fades—linearno fly-in, glide, slide, shimmer or scale; highlight and list change instantly; every announcement kept

Sizes (proposed): popover width 360 px (min 280, max 480; 560 with preview pane), list max height 320 px (about 9 rows), row 32 px (28 dense, 44 touch), group header 24 px, token height = line height − 2 px (18 px on a 20 px line), token max width 240 px, 6 px horizontal padding, 4 px radius.

Fuzzy matching (shared with composer-tools-menu.md): every query word must match the label as a prefix, a word start in the description or keywords, or as letters in order across the label (subsequence: "shpr" finds "Share project"); label-prefix matches rank first and groups follow their best Match. For paths, match the filename first, then directories; prefer recently opened and git-modified files; show the dimmed directory tail. Ties break by recency, then shortness.

Responsive behaviour

  • The list matches the field width, capped at 360 px.
Edge cases (spec)
  • Long labels ellipsize in the list (path tail kept: "…/middleware/auth.rs"); tokens truncate at 240 px with full name in the preview and accessible name.
  • Thousands of results (monorepo): sources return the top 50 per group; the list virtualises; "Show 1,200 more in Files" row at the end of a group.
  • Paths with spaces are inserted quoted in the serialised text; the token still shows the bare name.
  • Ambiguity. Two files named auth.rs: both rows show their directory tail; the token keeps the full path.
  • RTL. Popover anchors to the trigger's visual position and aligns to its start edge; tokens follow bidi rules as single neutral units; the type column mirrors; arrow keys stay ↑/↓ for the list.
  • IME. Detection waits for composition end; full-width / and @ are treated as triggers in CJK locales (proposed, configurable).
  • Tiny / dense IDE. In narrow panels (< 300 px) the popover takes the panel width and drops descriptions; token-chip/text is the default in terminal surfaces.
  • Touch. Tapping a row accepts; no hover cards (long-press shows them); the sheet keeps the text area visible above it.
  • Slow sources. Stale results stay usable; after 8 s the group shows Error with Retry while other groups still work. Very fast sources never show a skeleton.
  • Agent busy. Commands that would break the running turn are disabled with a reason; mentions are always allowed (they join the draft / queued message). Mode commands either queue for the next turn or are disabled, per app policy.
  • Pasting text that contains triggers does not open the popover; pasted @path strings that resolve to real files can be offered as tokens via one "Convert 3 mentions" hint (proposed).
  • Copy/paste of tokens keeps them as tokens inside Oxyn (structured clipboard, as coss ui does with its own MIME type [R126]) and as plain text (@src/auth.rs, /plan) elsewhere.
  • Undo. ⌘/Ctrl+Z after accept restores the raw query text and reopens nothing.
  • Deleted targets turn tokens Broken before send; send warns "1 mention can't be resolved".
  • Security. Tool/app mentions that would act on the user's behalf show the "runs" label and respect the approval policy; a mention is never an implicit approval.

Notes for AI

  • Import MentionInput from oxyn_dioxus and include COMPOSER_CSS plus the token stylesheet once.
  • A GPUI version exists: MentionListEl in oxyn_gpui.
  • Props to set first: suggestions.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI