Founding sponsorYour name here
Tags:
DesignQ3 Report

The removable pills inside the field are tokens — type one and press ⏎

Token Field

/ NSTokenField · NSTokenField.TokenStyle /

also called token input, recipient field, tag input, pill input

A token field converts recognized pieces of typed text into discrete rounded tokens, like recipients in a mail compose window. Each token represents one value and can be selected, edited, or removed without treating the whole field as plain text. AppKit provides token styling, completions, represented objects, and tokenizing separators through NSTokenField.

If you called it…

the text field with removable pills inside itthe email address bubbles in the To fieldinput that turns words into little tagsrounded chips you can delete from a fieldthe field where each recipient becomes its own bubble

…you meant a token field.

Anatomy — every part, named

  1. 1
    Token capsuleNSTokenField.TokenStyle

    “The little rounded bubble around each recipient” is a token capsule.

  2. 2
    Selected tokenNSTokenField

    “The whole pill that highlights before I delete it” is the selected token.

Prompt — paste into your agent

Use a native Token Field (NSTokenField) with NSTokenField.TokenStyle so each recognized recipient or tag becomes a separately selectable, removable rounded token inside the editable field. Preserve token completion and keyboard deletion behavior.

Debug prompt — when it misbehaves

Paste this, then describe what you’re seeing — it hands your agent the classic failure modes to rule out first.

Debug my macOS token field (NSTokenField). Rule out: text not becoming tokens until Return because the tokenizing character set lacks your separator; represented objects vs display strings confused in the delegate so tokens show raw identifiers; completions never appearing because the completion delegate method is not implemented; copy producing plain text because writing represented objects to the pasteboard is unimplemented. The symptom:

In code

The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).

AppKitNSTokenField
AppKitNSTokenField.TokenStyle
AppKitNSTokenFieldDelegate

See also

Search

Describe the UI element you're thinking of