Give the triggers and their items. The content, the footer with the notice, and the list are parts.
comment-field.tsx
MentionInput
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. The name of the field for screen readers, when no visible label names it. |
| value | string | — | The saved value: text with @[label](id) tokens. Controlled. |
| default | string | "" | The first value when uncontrolled. Default "". |
| on | — | Called with the new value on each edit. | |
| triggers | — | What opens a list: @ people, # channels. | |
| max | number | 20 | The most people a value may mention. Past it the field is invalid. Default 20. |
| on | — | Called with a row whose person cannot see the page (access: false). | |
| on | — | Called on Cmd or Ctrl + Enter with the value (send the comment). | |
| placeholder | string | "" | The text of the empty field. |
| disabled | boolean | false | |
| read | boolean | false | A sent comment: the text and chips show, with no field around them. |
| invalid | boolean | false | Force the error look (a server error). The mention limit sets it by itself. |
| name | string | — | The form field name: the value goes with the form (FormValue). |
| labels | — | ||
| children | ReactNode | — | 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
MentionInputFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
MentionInputNotice
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
MentionInputCount
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
MentionInputError
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
MentionInputPopup
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | — | Show an arrow that points at the trigger. The gap grows from 4px to 8px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | — | Put a clear layer under the popup (Base UI Popover.Backdrop), for example to dim it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show | boolean | — | 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<PopoverBackdropProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<PopoverArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIPopover.PortalBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position | "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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| side | number | OffsetFunction | 0 | Distance 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @or# | Opens the list of the trigger at the caret. |
|---|---|
| ↑ ↓ | Moves the highlight in the open list. Focus stays in the text. |
| EnterorTab | Puts the highlighted row in the text as a chip. |
| Escape | Closes the list and keeps the typed text. |
| Backspace | Next to a chip, selects it first. A second Backspace removes it. |
| Cmd/CtrlEnter | Calls onSubmit with the value. |
| Cmd/CtrlZ | Undoes the last edit. |





