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

    7
  • Chart

    Chart

    3
  • Radio Card

    Radio Card

    2
  • Badge

    Badge

    2
  • Card

    Card

    2
  • Switch

    Switch

    1
  • Checkbox Card

    Checkbox Card

    1
  • Input

    Input

    1

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