"use client";
import { Mentions } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly MentionItem[] | — | Items to render. |
onValueChange | (value: string) => void | — | Called with the new value (only when it changes). |
value | string | — | Current value (controlled); null where it means "nothing selected". |
clearLabel | string | — | — |
defaultValue | string | — | Initial value when uncontrolled. |
emptyLabel | ReactNode | — | — |
invalid | boolean | — | Marks the control invalid (aria-invalid); FormField sets it from error. |
onClear | () => void | — | — |
onMentionSelect | (item: MentionItem) => void | — | — |
size | ComponentSize | — | Size from the shared scale (xs, sm, md, lg). |
trigger | string | — | — |
itemsrequiredreadonly MentionItem[]
Items to render.
onValueChange(value: string) => void
Called with the new value (only when it changes).
valuestring
Current value (controlled); null where it means "nothing selected".
clearLabelstring
defaultValuestring
Initial value when uncontrolled.
emptyLabelReactNode
invalidboolean
Marks the control invalid (aria-invalid); FormField sets it from error.
onClear() => void
onMentionSelect(item: MentionItem) => void
sizeComponentSize
Size from the shared scale (xs, sm, md, lg).
triggerstring
const people = [
{ id: "ada", label: "Ada", value: "ada" },
{ id: "linus", label: "Linus", value: "linus" },
];
const [comment, setComment] = useState("");
<Mentions items={people} value={comment} onValueChange={setComment} />