Skip to content

Mention Input

Free

A text field that turns @people and #channels into chips. A line shows who gets a notice, and the value keeps their ids, not their names.

  • TipTap
  • React 19
  • Tailwind CSS 4

Added Nov 17, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Give the triggers and their items. The content, the footer with the notice, and the list are parts.

comment-field.tsx

MentionInput

<div>
PropTypeDefaultDescription
aria-labelstring—Defines a string value that labels the current element. The name of the field for screen readers, when no visible label names it.
valuestring—The saved value: text with @[label](id) tokens. Controlled.
defaultValuestring""The first value when uncontrolled. Default "".
onValueChange—Called with the new value on each edit.
triggersRequired—What opens a list: @ people, # channels.
maxMentionsnumber20The most people a value may mention. Past it the field is invalid. Default 20.
onGiveAccess—Called with a row whose person cannot see the page (access: false).
onSubmit—Called on Cmd or Ctrl + Enter with the value (send the comment).
placeholderstring""The text of the empty field.
disabledbooleanfalse
readOnlybooleanfalseA sent comment: the text and chips show, with no field around them.
invalidbooleanfalseForce the error look (a server error). The mention limit sets it by itself.
namestring—The form field name: the value goes with the form (FormValue).
labels—
childrenReactNode—The parts. Default: the text, the footer with the notice, and the list.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

MentionInputContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

MentionInputFooter

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

MentionInputNotice

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

MentionInputCount

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

MentionInputError

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

MentionInputPopup

<div>
PropTypeDefaultDescription
classNamestring—
arrowboolean—Show an arrow that points at the trigger. The gap grows from 4px to 8px.
backdropboolean—Put a clear layer under the popup (Base UI Popover.Backdrop), for example to dim it.
showCloseButtonboolean—Show a close button (a 24px ghost icon button) 10px from the top and the end.
padding"default""none""tight"—default: radius 14, 12px padding and 10px between the parts, 288px wide. tight: 4px padding and 4px between the parts, as wide as the content: a row of 28px actions (a plain Toolbar) with the 4px inset of the bar recipe, 38px high (the selection pill of the Quote Reply). none: no padding and no gap, as wide as the content: a panel that lays out its own parts edge to edge (a head with a rule, a scroll box, a docked composer: the Chat Popup). Give it a width and a height with layout classes; the body fills that height.
portalProps—Other Base UI props of the inner parts. A className here adds to the component classes.
positionerProps—
backdropPropsPopupPartProps<PopoverBackdropProps>—
arrowPropsPopupPartProps<PopoverArrowProps>—
closeButtonProps—
From Base UIPopover.PortalBase UI docs
positionMethod"absolute""fixed"'absolute'Determines which CSS position property to use.
side"bottom""inline-end""inline-start""left""right""top"'bottom'Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
sideOffsetnumber | OffsetFunction0Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Give one trigger per list in triggers: @ with the people, # with the channels.
  • Use search on a trigger for a directory too big to send; it runs 150ms after the last key and aborts the older search.
  • Save the value as it is: each mention is @[label](id), so a renamed person still points to the right id.
  • Put MentionInputNotice in the footer, so the writer sees who gets a notice before sending.
  • For plain text with no mentions, use a Textarea.
  • For a list of tags or emails with no text around them, use a Tags Input.
@or#Opens the list of the trigger at the caret.
↑ ↓Moves the highlight in the open list. Focus stays in the text.
EnterorTabPuts the highlighted row in the text as a chip.
EscapeCloses the list and keeps the typed text.
BackspaceNext to a chip, selects it first. A second Backspace removes it.
Cmd/CtrlEnterCalls onSubmit with the value.
Cmd/CtrlZUndoes the last edit.
New chip
fade · 150ms · a picked chip fades in
List
popup · 150ms · ease-panel · fades in and scales from 95% at the caret

Built with

Installs with Mention Input

  1. AddedMention Input, with Avatar, Button, Dot, Popover, Skeleton.
Open the release