Skip to content

EnChipGroup ​

Preview ​

Props ​

NameDescriptionDefaultControl
qaId

Id that can be set for automation selectors.

string
""
chips

The chips to render — strings, or objects with label and value keys. An object may also carry context, chipStyle, pill, removable, clickable, disabled, href, removeLabel or qaId to override the group's setting for that one chip.

unknown[]
unknown
labelKey

Sets a different key to use to retrieve the label from the chips passed to the component.

string
"label"
valueKey

Sets a different key to use to retrieve the value from the chips passed to the component.

string
"value"
context

Context applied to every chip in the group.

string
""
chipStyle

Treatment applied to every chip in the group.

string
"tonal"
pill

Renders every chip fully rounded.

boolean
false
removable

Gives every chip a remove button.

boolean
false
clickable

Makes every chip's name a control that emits click.

boolean
false
disabled

Dims the group and stops it responding.

boolean
false
max

How many chips to show before collapsing the rest into a +N more chip. Zero shows all of them.

number
0
addLabel

Renders a trailing chip that emits add — the "+ Add class" affordance that belongs inside the row rather than beside it. Omit for no add chip.

string
""
emptyText

Shown when there are no chips. Omit to render nothing.

string
""

Slots ​

chip

No description

Variables
NameTypeDescription
chipunknown—
indexunknown—

add

No description

empty

No description

Events ​

update:chips

No description

remove

No description

Methods ​

No methods defined.

Guidelines ​

Use EnChipGroup as soon as the chips come from an array — a set of classes assigned to a contribution group, the tags on a record, the locations a plan covers. It builds the row from data and owns the removal plumbing, so the only thing left to write is what removal means.

Reach for a bare EnChip only for one or two fixed chips that aren't a list.

The data shape ​

Takes strings or objects — the same shape EnInputRadioGroup accepts. labelKey and valueKey point at other keys, and a PascalCase fallback means serialized .NET data works unchanged.

Any chip object may also carry context, chipStyle, pill, removable, clickable, disabled, href, removeLabel or qaId to override the group's setting for that one chip.

Removal: bind it, or handle it ​

Pressing a chip's × does two things: emits update:chips with the list minus that entry, and emits remove with the chip's value. Both fire either way, so:

  • Bind v-model:chips and the list manages itself.
  • Or listen to remove and splice the array yourself.
  • Or do both — bind the model for the list, and hang a save or a toast off remove.

The chips prop is never mutated.

Dos ​

  • Set emptyText on any group that can legitimately be empty. A row that silently renders nothing reads as a broken page.
  • Use addLabel for the add affordance rather than a button beside the row — it belongs inside the row, wrapping with the chips.
  • Use max on a group whose length is unbounded, so a record with forty tags doesn't push the rest of the panel off the screen.

Don'ts ​

  • Don't use a chip group as a form control for selecting values — that's EnInputCheckboxGroup or EnInputSelectPlus. A chip group displays what is already chosen.
  • Don't set removable on a group whose entries can't actually be removed.

Examples ​

A tag row from plain strings ​

Objects, with a per-chip override ​

The Executive chip sets removable: false, so it stays put while the rest can be dropped.

Overflow ​

max caps how many chips show at once and collapses the rest behind a +N more chip that reveals them when pressed.

Replacing the chip rendering ​

The chip slot is scoped with { chip, index } and replaces every chip — for when a row needs something the props don't reach, such as an icon per entry.