Usage
label, paint with intent, height with size, and a decorative leading icon or avatar.onRemove with removeLabel and removedAnnouncement adds a remove Button after the label. Activating it calls onRemove(details), then announces removedAnnouncement politely, unless the handler calls details.cancel(). The consumer removes the token from its own state. The token that held focus unmounts, so the consumer also moves focus, usually back to the entry.removeLabel ("Remove Dana Levi"), not just "Remove": a row of tokens would otherwise read as identical buttons. removedAnnouncement is a whole sentence ("Dana Levi removed") because it is read with no visual context.onRemove call and announcement as a click. A held key, a modified key and an input-method composition are ignored, so one press never removes a run of tokens.shouldRemoveLastTokenOnBackspace(event):ab in the entry, Backspace deletes b, then a, and only the next press, with the entry empty, removes a token. The token that is removed this way never held focus, so the composer calls announceTokenRemoval itself.selected (controlled), or defaultSelected and onSelectedChange, to turn the label into a toggle button with aria-pressed, for a filter that can be switched on. Selected adds a wash and an accent edge, so it does not rest on color alone. A token can be both selectable and removable; the toggle and the remove button are siblings, never nested.disabled disables the toggle and the remove button, ignores Backspace and Delete, and paints the disabled foreground on the disabled surface (ADR 0015). A token inside a disabled fieldset takes the same paint with no prop.title.