EnChip
Preview
Props
| Name | Description | Default | Control |
|---|---|---|---|
| qaId | Id that can be set for automation selectors. string | "" | |
| label | The chip's text. The default slot overrides it, and it supplies the
remove button's accessible name when string | "" | |
| context | Context that sets the chip's color. string | "" | |
| chipStyle | How the context color is applied. string | "tonal" | |
| pill | Renders the chip fully rounded. Chips are the one deliberate exception to the system's 6px radius — don't reach for a pill elsewhere. boolean | false | |
| removable | Adds a trailing × that emits boolean | false | |
| clickable | Makes the chip's name a control that emits boolean | false | |
| href | Renders the chip as a link to this href. string | "" | |
| disabled | Dims the chip and stops it responding. boolean | false | |
| removeLabel | Accessible name for the remove button. Defaults to "Remove {label}", or plain "Remove" when there is no label — pass something specific when the content comes from the slot, or a screen reader hears a row of chips as several identical "Remove" buttons. string | "" |
Slots
default
No description
action
No description
Events
click
No description
Methods
No methods defined.
Guidelines
A chip is a small token that labels a thing — a class assigned to a contribution group, a tag on a record, a status count. It carries more visual weight than a badge and less than a button.
Two axes: context and treatment
context sets the color; chipStyle sets how that color is applied. They are independent, so any context works in any treatment.
chipStyle | Looks like | Reach for it when |
|---|---|---|
tonal (default) | Light tint fill, darker ink | A row of tags. It labels content rather than competing with it — the right default. |
solid | Saturated fill, white ink | A status that has to carry across a dense table. |
outline | No fill, 1px border in the ink color | The quietest token, or a chip that is a control (Add, +N more). |
Warning chips use the palette's yellow.dark tone rather than the semantic $warning-color, because chip text is 12px and the semantic yellow does not reach 4.5:1 against it. That is handled for you — don't override a warning chip's colors to "match" a warning label elsewhere.
Dos
- Keep the text to one or two words, so a row of chips stays scannable.
- Use
tonalunless you have a reason not to. - Give
removeLabela specific value when the chip's content comes from the default slot — otherwise a screen reader hears a row of identical "Remove" buttons. - Reach for EnChipGroup as soon as the chips come from an array — it handles the removal plumbing, group defaults, and overflow.
Don'ts
- Don't use a chip for a primary action or a workflow step. That's a button.
- Don't use
pillon anything that isn't a chip. Chips are the one deliberate exception to the system's 6px radius. - Don't expect the chip to remove itself.
removeis a request; the parent owns the list.
Examples
The root element is inferred
A chip is only ever as interactive as it needs to be, so you never have to pick a tag:
| Props | Renders | What is clickable |
|---|---|---|
| (none) | <span> | nothing |
href | <a> | the whole chip |
clickable | <button> | the whole chip |
removable | <span> | the × only |
clickable + removable | <span> | the name and the × separately |
That last row is the two-hit-area case: click the name to open or edit the thing, click the × to remove it. It cannot be one button, so clickable gives the name its own control instead of promoting the root.
Treatments and contexts
Removable, clickable, and both
Custom content
The default slot replaces the label, for a chip that needs more than text — a leading status glyph, say.
Related
- EnChipGroup — a row of chips built from data.
- Chips styleguide — the raw classes, and when a chip beats a badge or a label.