structyl

Mentions

stable

A textarea with @-mention autocomplete.

Basic usage

Examples

With default value

Pre-populate the textarea with an existing mention to show highlighted tokens.

People mention textarea

Mentions connects a textarea with filtered suggestions and custom item rendering.

Features

  • Trigger character.
  • Suggestion filtering.

Installation

bash
pnpm dlx structyl add mentions

API Reference

Mentions.Root

An @-mention textarea.

PropTypeDefault
valuestring

Controlled text.

onValueChange(value: string) => void

Called when the text changes.

triggerCharstring

Character that opens suggestions.

'@'

Mentions.Textarea

The editable textarea.

PropTypeDefault

Mentions.Suggestions

The suggestion popover.

PropTypeDefault
itemsMentionSuggestion[]

Suggestion data.

Mentions | structyl