Home / Components / Mention Mention detects an @ query in the current text and lets the application supply matching entries. A selected entry is written into the value.
Type @ followed by a few letters, then choose a suggestion. The example discards outdated responses if the query changes.
Demo Source
Message Selected ยท โ Value ยท
Edit the visible label and try required, read only and disabled states.
Demo Source
Live preview Message Selected ยท โ <neu-mention [label]="label()" [(value)]="value" [suggestions]="suggestions()" [disabled]="disabled()" [readonly]="readonly()" [required]="required()" (queryChange)="search($event)" (suggestionSelected)="chosen.set($event.label)" />These values match the current preview. Complete handlers, Core imports and templates are in Source.
import { signal } from '@angular/core';
export const label = signal("Message");
export const value = signal("");
export const suggestions = signal([]);
export const disabled = signal(false);
export const readonly = signal(false);
export const required = signal(false);Bind value as a model. Handle queryChange to supply suggestions and suggestionSelected to respond to a selection.
The examples use visible labels and follow the focus order of the live controls.
Arrow Down / Arrow Up Move the active option while suggestions are open. Enter Insert the active suggestion. Escape Close the suggestion list.
Configure the suggestion list and popup behavior, then read selection events and text changes.
Inputs Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
disabledbooleanfalse[disabled]Prevent interaction with the field. invalidbooleanfalse[invalid]Marks the field as invalid. labelstringRequired [label]Visible label for the message field. readonlybooleanfalse[readonly]Show the text without allowing edits. requiredbooleanfalse[required]Expose the required state to the field. suggestionsreadonly NeuMentionSuggestion [][][suggestions]Suggestions for the current query. suggestionsLabelstringinject(NEURAL_LOCALE).toLowerCase().startsWith('es')
? 'Sugerencias de menciones' : 'Mention suggestions'Derived default [suggestionsLabel]Accessible name of the suggestions list.
Models A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.
valuestring''[(value)]Current message, including inserted mentions.
Outputs Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
queryChangestring | null(queryChange)="onQueryChange($event)"Reports the active query or null when it ends. suggestionSelectedNeuMentionSuggestion (suggestionSelected)="onSuggestionSelected($event)"Reports the selected suggestion. touchvoid(touch)="onTouch($event)"Reports that focus left the field.
Templates ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
This component does not expose content projection or public customization templates.
Public Types Open a type to inspect its definition and interface fields.
import type { NeuMentionSuggestion } from '@neural-ui/core/mention';
// Public declaration (reference only)
interface NeuMentionSuggestion {
readonly label: string;
readonly value: string;
}Mention uses theme values shared with text inputs and list surfaces.
Specific tokens This component uses shared theme tokens rather than dedicated component hooks.
Shared tokens used Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.
PreviousListbox Next NumberInput