About
Chip field where Enter, comma or Tab adds a tag that springs in while the rest glide aside via shared layout, with Backspace-twice removal, arrow-key chip navigation, a filtered keyboard-navigable suggestion combobox, max tags, duplicate prevention and a shake on validation rejection; controlled/uncontrolled, reduced-motion safe.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tag Input to your project and fits it to your theme.
Code
How Tag Input is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client"
import { useState } from "react"
import { TagInput } from "@/components/ui/karaui-tag-input"
const TOPICS = [
"React",
"Next.js",
"TypeScript",
"Tailwind CSS",
"Motion",
"Accessibility",
"Design systems",
"Animation",
"Server components",
"Testing",
];
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export function TagInputPreview() {
const [topics, setTopics] = useState(["React", "Motion"]);
return (
<div className="flex w-full max-w-md flex-col gap-6">
<TagInput
label="Topics"
value={topics}
onChange={setTopics}
suggestions={TOPICS}
maxTags={5}
placeholder="Add a topic…"
hint="Enter, comma or Tab to add · Backspace twice to remove"
/>
<TagInput
label="Invite by email"
defaultValue={["ada@example.com"]}
placeholder="name@company.com"
validate={(tag) => EMAIL.test(tag) || "That doesn't look like an email"}
hint="Paste a comma-separated list to add several"
/>
</div>
);
}
export default TagInputPreview
















