A pill is a visual representation of an attribute, usually representing tags or metrics.

Example

⌘ Cmd + ⌥ Option + 1

Properties

propertypropTyperequireddefaultdescription
hasWrapbool-trueWhether or not the token should have a wrap
isDismissiblebool-false Determines if token has dismissible feature or not. If true, `onDismiss`
is required.
styleoneOf 'primary' | 'secondary' | 'tertiary' | 'error'-'secondary'Determines style of token depending on priority level or error
showWellbool-trueWhether or not a well is presented around the token.
descriptionstring--Description explaining the token
hasSnugWrapbool--Whether or not the token should have a tighter wrap
isDraggablebool--Shows an icon indicating that the token is draggable
namestringyes-Name label on token
onDismissfunc-- Function to call that dismisses the token. Required if the token is
dismissible.
ordernumber--Show a number indicating the token's order
testSectionstring--Hook for automated JavaScript tests

Usage

Pills can be non-interactive for display only, as well as interactive for drag reordering and single-click removal. Typically pills display a known entity type in our application such: a tag, audience, interest group, or a user-defined metric.

Best Practices

Do

If your pill text is long consider using the short description area for more text space

Don't

Avoid all uppercase text inside pills