---
title: "TagInput"
description: "Free-form tags (Enter adds); options are suggestions."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TagInput

```gistui
root = Form("share", TagInput("emails", "Share with", type:email, placeholder:"Type an email and press Enter", value:["ada@example.com"], required))
```

## Signature

This is the line a model reads in the system prompt.

```gistui
TagInput(name, label, options:[str], value:[str], type:text|email|url, placeholder:str, min:num, max:num, error:str, bind:$var, size:Size, hint:str, required)
```

- **Group:** Forms
- **Children:** No
- **Positional arguments:** `name`, `label` (a trailing `?` means it may be left out)

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `name` | string | positional, required |  |
| `label` | string | positional, required |  |
| `options` | list of string | named: `options:…` |  |
| `value` | list of string | named: `value:…` |  |
| `type` | `text` · `email` · `url` | named: `type:…` | Default `"text"`. each tag is checked |
| `placeholder` | string | named: `placeholder:…` |  |
| `min` | number | named: `min:…` |  |
| `max` | number | named: `max:…` |  |
| `error` | string | named: `error:…` |  |
| `bind` | `$state` variable | `bind:$name` | two-way binding to a $variable |
| `size` | `sm` · `md` · `lg` | named: `size:…` | Also accepts `small`, `medium`, `large`. |
| `hint` | string | named: `hint:…` |  |
| `required` | flag | bare word: `required` |  |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ TagInput: MyTagInput });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ TagInput: MyTagInput }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ TagInput: MyTagInput }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ TagInput: MyTagInput }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ TagInput: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="TagInput"]`.

Source: https://gistui.com/docs/components/forms/tag-input/index.mdx
