Multi-Select Token Pills
Add a tag and it pops in; remove one and the gap closes cleanly.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | TokenPill[] | - | Controlled tokens. |
defaultValue | TokenPill[] | - | Default tokens for uncontrolled usage. |
onChange | (next: TokenPill[]) => void | - | Fired on every add or remove. |
placeholder | string | "Add a tag…" | Placeholder for the input. |
validate | (raw: string) => { invalid?: boolean } | void | - | Validate a freshly typed token before it is committed. |
delimiters | RegExp | /[,;\s]+/ | Characters that commit the current input as a token. |
max | number | - | Maximum number of tokens. Adding past this is a no-op. |
label | string | - | Optional label rendered above the field. |
disabled | boolean | false | Disable the entire control. |