# Tag Input

Add and remove tags inline



<ComponentPreview base="ink" name="tag-input-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/tag-input
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="ink" name="tag-input" title="components/ui/tag-input.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { TagInput } from "@/components/ui/tag-input";
```

```tsx
<TagInput placeholder="Add a tag…" onChange={(tags) => {}} />
```

API Reference [#api-reference]

TagInput [#taginput]

| Prop          | Type                       | Default                   |
| ------------- | -------------------------- | ------------------------- |
| `value`       | `string[]`                 | -                         |
| `onChange`    | `(tags: string[]) => void` | -                         |
| `placeholder` | `string`                   | `"Type and press Enter…"` |
| `maxTags`     | `number`                   | -                         |
| `delimiter`   | `string`                   | -                         |
