Mentions
stableA 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 mentionsAPI Reference
Mentions.Root
An @-mention textarea.
| Prop | Type | Default |
|---|---|---|
| value | stringControlled text. | — |
| onValueChange | (value: string) => voidCalled when the text changes. | — |
| triggerChar | stringCharacter that opens suggestions. | '@' |
Mentions.Textarea
The editable textarea.
| Prop | Type | Default |
|---|
Mentions.Suggestions
The suggestion popover.
| Prop | Type | Default |
|---|---|---|
| items | MentionSuggestion[]Suggestion data. | — |