v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

MentionsInput

Plain-text mentions with a keyboard suggestion list.

Interactive preview

Usage

import { MentionsInput } from "@devvy-ui/react";

<MentionsInput label="Comment" name="comment" options={[{id:'ada',label:'Ada Rivera',handle:'ada'}]} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
optionsMentionOption[]requiredIds, labels, safe handles and optional disabled.
value / defaultValuestringemptyPlain text.
onValueChange(text: string) => void—Text callback.

Accessibility & behavior

Platform Behavior & Guidelines

Type @ at the caret, filter people, use arrows/Enter or touch to insert a plain-text handle. Escape dismisses; IME and textarea form/reset remain native. Only word/hyphen handles are accepted; no HTML is created.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add mentions-input

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

MentionsInput.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.