Cnippet

Tag Input

Forms

About

A text input that turns typed entries into removable tag chips, supporting comma/enter commits, paste-splitting, duplicate/invalid rejection, and a max tag count.

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 * as React from "react";
import { TagInput } from "@/components/ui/tag-input";

export default function TagInputDemo() {
  const [tags, setTags] = React.useState<string[]>([
    "maya@acme.dev",
    "jordan@acme.dev",
  ]);

  return (
    <div className="flex w-full max-w-sm items-center justify-center p-10">
      <TagInput value={tags} onValueChange={setTags} placeholder="Add a tag" />
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.4K
  • Davincho Hero-1

    Davincho Hero-1

    721
  • Aero Hero-3

    Aero Hero-3

    638
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    602
  • Features

    Features

    542
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    497
  • Text Reveal

    Text Reveal

    408
  • Blogs

    Blogs

    407

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    613
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52