Componentmedia1.37 KB gzipZero dependencies
Mention Input
Mention input with instant @ autocomplete popover.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add mention-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { MentionInput } from "@/components/ui/mention-input"; <MentionInput placeholder="Type @ to assign seat tier..." />Source code
mention-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxmention-input.tsx161 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface MentionItem { id: string; name: string; category?: string;} export interface MentionInputProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> { mentions?: MentionItem[]; value?: string; defaultValue?: string; onValueChange?: (val: string) => void; className?: string;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { MentionInput } from "@/components/ui/mention-input"; <MentionInput />| Prop | Type | Description |
|---|---|---|
| mentions | MentionItem[] | Configures mentions. |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (val: string) => void | Callback invoked on value change. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |