Componentmedia1.37 KB gzipZero dependencies

Mention Input

Mention input with instant @ autocomplete popover.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add mention-input

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { MentionInput } from "@/components/ui/mention-input"; <MentionInput placeholder="Type @ to assign seat tier..." />

Source code

mention-input.tsx + 1 helper

Zero 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 />
PropTypeDescription
mentionsMentionItem[]Configures mentions.
valuestringControlled value.
defaultValuestringInitial value when uncontrolled. (Default: "")
onValueChange(val: string) => voidCallback invoked on value change.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.