Tags are objects that hold text and have a delete icon to remove them. They can appear within TextFields, TextAreas, ComboBox or as standalone components.
also known as Chip, Pill, Filter Tag
Props
Best Practices
Write succinct labels for Tag — ideally two or fewer words.
Intermix removable and unremovable Tags in a group. Group or separate Tags that are removable from those that are unremovable. This creates a clear pattern to the user for which Tags can be removed and which cannot.
Accessibility
Localization
Be sure to localize text
and accessibilityRemoveIconLabel
. Be mindful of label length so that it doesn’t truncate in languages with lengthier character counts.
Variants
Dismissable
If not disabled, Tags are dismissable by the "X" affordance, which triggers the onRemove
callback. If your app uses DefaultLabelProvider, a default value for this label will be used. This can be overridden with a more specific label if desired.
Disabled
When disabled, Tags are visible but cannot be removed.
If this condition is constant (not determined dynamically), onRemove
can use a no-op (e.g. () => {}
).
Error
Use type="error"
to communicate an error state to the user.
Warning
Use type="warning"
to communicate a warning state to the user.
Max width
Tag has a maximum width of 300px. Longer text will be truncated, but can be seen by hovering over the Tag.
Component quality checklist
Quality item | Status | Status description |
---|---|---|
Figma Library | Partially ready | Component is live in Figma, however may not be available for all platforms. |
Responsive Web | Ready | Component is available in code for web and mobile web. |
iOS | Component is not currently available in code for iOS. | |
Android | Component is not currently available in code for Android. |