Mahmoud Ilyan

Tags Input

Forms

About

An input field for entering and managing a list of tags, where each tag can be added, edited, deleted, or cleared with keyboard and mouse interactions.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tags Input to your project and fits it to your theme.

Code

How Tags 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 {
  TagsInput,
  TagsInputLabel,
  TagsInputList,
  TagsInputInput,
  TagsInputItem,
  TagsInputClear,
} from "@/components/ui/tags-input";

export default function TagsInputDemo() {
  const [value, setValue] = React.useState(["React", "TypeScript", "Tailwind"]);

  return (
    <div className="flex items-center justify-center p-10">
      <TagsInput value={value} onValueChange={setValue} editable max={8}>
        <TagsInputLabel>Skills</TagsInputLabel>
        <TagsInputList>
          {value.map((tag) => (
            <TagsInputItem key={tag} value={tag}>
              {tag}
            </TagsInputItem>
          ))}
          <TagsInputInput placeholder="Add a skill..." />
        </TagsInputList>
        <TagsInputClear className="self-start text-xs text-muted-foreground underline-offset-2 hover:underline">
          Clear all
        </TagsInputClear>
      </TagsInput>
    </div>
  );
}

Dependencies

More by Mahmoud Ilyan

View all
  • Steps

    Steps

    5
  • Chart

    Chart

    2
  • Radio Card

    Radio Card

    1
  • Switch

    Switch

    1
  • Input

    Input

    1
  • Badge

    Badge

    1
  • Textarea

    Textarea

  • Tabs

    Tabs

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19