Skip to content

InputsLumen Halo

Mention ComposerProv1.0.0

Write a note and mention people by typing @: suggestions open at the caret and narrow as you type, and a picked name becomes a mention that's highlighted, deleted as a whole and kept with its id. A real textarea underneath, so editing, spellcheck and undo stay native.

Built on shadcn/ui

.md
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-mention-composer

Needs your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import * as React from "react";
import { MentionComposer, type MentionValue } from "@/components/ui/lumen/controls/mention-composer";

const team = [
  { id: "u1", label: "Maya Chen", description: "Design" },
  { id: "u2", label: "Tomás Ruiz", description: "Data" },
];

export function Comment() {
  const [note, setNote] = React.useState<MentionValue>({ text: "", mentions: [] });
  return <MentionComposer value={note} onValueChange={setNote} suggestions={team} placeholder="Write a comment, @ to mention" />;
}

Props

  • suggestions–

    MentionEntity[] | (query, signal) => Promise<MentionEntity[]>

    Who can be mentioned ({ id, label, description? }): a list filtered as you type, or your search (abort on the signal).

  • value / defaultValue / onValueChange–

    { text, mentions: { id, label, start, end }[] }

    The text and the mentions with their ids and positions. mentionSegments(value) gives ordered segments.

  • onSubmit–

    (value) => void

    ⌘ / Ctrl + Enter.

  • trigger"@"

    string

    The character that starts a mention.

  • rows / placeholder / disabled3

    textarea props

    As on a textarea.

  • labels–

    object

    suggestions, noMatch and count(n), for other languages.

Source

components/ui/lumen/controls/mention-composer.tsx

This component is included with Pro.

Try the live preview above. Get Pro to install the source.