Infragistics
Close
Angular React Web Components Blazor Angular
Open Source

Chip Component

The Ignite UI for Angular Chip is a compact element that represents a tag, filter, or person and that users can select or remove.

A chip can be selectable, removable, or both, and can show icons or other content before and after its label.

Live Demo

Anatomy

The Angular Chip is a container that holds a label and optional icons in a single row.

Angular Chip anatomy: container, selection icon, left icon, label, right icon, and remove icon
1. Container: holds all chip elements and defines its visual boundary2. Selection Icon: indicates the chip is selected3. Left Icon (optional): displayed on the left side of the label
4. Label: the text that identifies or describes the chip’s value5. Right Icon (optional): displayed on the right side of the label6. Remove Icon: cancel icon indicates when a chip can be removed
igx-chip[role="option"]               // host; aria-selected reflects `selected`
└─ div.igx-chip__item                 // chip wrapper; drag and drop target
   ├─ div.igx-chip__start
   │  ├─ div.igx-chip__select         // select icon, shown while selected
   │  └─ [igxPrefix]                  // content before the label
   ├─ div.igx-chip__content           // label (projected content)
   └─ div.igx-chip__end
      ├─ [igxSuffix]                  // content after the label
      └─ div.igx-chip__remove         // remove control, rendered when removable

Getting Started

Install Ignite UI for Angular and configure a theme, as described in the Getting Started topic, before you add the Angular Chip to an application.

Import IGX_CHIPS_DIRECTIVES into your component. It includes the chip, the chips area, and the igxPrefix and igxSuffix directives.

import { Component } from '@angular/core';
import { IGX_CHIPS_DIRECTIVES } from 'igniteui-angular/chips';

@Component({
  selector: 'app-chip-sample',
  imports: [IGX_CHIPS_DIRECTIVES],
  template: `<igx-chip>Design</igx-chip>`,
})
export class ChipSampleComponent {}

Prerequisites and Version Compatibility

Some Angular Chip features depend on the package version that your application uses.

Use the igniteui-angular package. The outlined input is available in 22.2.0 and later.

Usage

Add a label to the Angular Chip, then add icons, a type, a size, and selection or removal as your layout needs.

Layout

The Angular Chip supports content templating around its label. Mark content with the igxPrefix and igxSuffix directives to show it before and after the label, such as text or an Icon. Icons in the chip follow its size, so they also come in three sizes: large, medium, and small.

Place the label inside the chip. Set the selectIcon and removeIcon inputs to templates that replace the default select and remove icons.

<igx-chip selectable removable [selectIcon]="selectIcon" [removeIcon]="removeIcon">
  <igx-icon igxPrefix>person</igx-icon>
  Ana Zane
  <igx-icon igxSuffix>mail</igx-icon>
</igx-chip>

<ng-template #selectIcon>
  <igx-icon>check_circle</igx-icon>
</ng-template>

<ng-template #removeIcon>
  <igx-icon>delete</igx-icon>
</ng-template>

Custom selectIcon and removeIcon templates replace the default icons, including their accessible labels, so give your icons an accessible label.

Types

The Angular Chip provides two types: Default and Primary.

Leave variant unset for the default type, or set it to primary for the primary type. The variant also accepts info, success, warning, and danger for status colors.

<igx-chip>Default</igx-chip>
<igx-chip variant="primary">Primary</igx-chip>

Outlined

Set outlined to render the chip with a border and the outlined background. You can combine it with any variant.

<igx-chip outlined variant="info">Draft</igx-chip>

Size

The Angular Chip comes in three sizes:

  • Large: suitable for interactive scenarios, such as action triggers.
  • Medium: suitable for short areas, such as the recipient field of an email composer.
  • Small: suitable for data-dense scenarios, such as the values in a grid cell.

Set --ig-size to var(--ig-size-small), var(--ig-size-medium), or var(--ig-size-large) to change the chip size. Set it on a chip, or on a container to size all chips inside it.

.filter-chips {
  --ig-size: var(--ig-size-small);
}

Interaction State

The Angular Chip can be enabled or disabled.

Set disabled to prevent interaction. A disabled chip can’t receive focus or be selected, and it doesn’t render the remove icon, even when removable is set.

<igx-chip disabled>Archived</igx-chip>

State

When users interact with the Angular Chip, it changes from its default idle state to hover, focused, and selected.

The selected state needs selection to be enabled. Set selectable to let users toggle the chip by clicking it or pressing Space. Each toggle updates selected and emits a selection event with the new state. Set selected to define the initial state.

The cancelable selectedChanging event reports the new state in selected, and selectedChanged follows after the state changes. Bind [(selected)] to keep the state in your component. The select icon appears whenever selected is true.

<igx-chip selectable [(selected)]="isBold" (selectedChanging)="onSelectedChanging($event)">Bold</igx-chip>
import { IChipSelectEventArgs } from 'igniteui-angular/chips';

public isBold = true;

public onSelectedChanging(event: IChipSelectEventArgs) {
  console.log(event.selected); // the new selected state
}

Remove Chip

A removable Angular Chip shows a remove icon at its end that users activate to request the chip’s removal.

Set removable to show the icon. Activating the icon emits a remove event, but the chip stays on the page. Remove the chip, or the item it represents, in the event handler.

@for (chip of chips; track chip.id) {
  <igx-chip [id]="chip.id" removable (remove)="onRemove($event)">{{ chip.text }}</igx-chip>
}
import { IBaseChipEventArgs } from 'igniteui-angular/chips';

public chips = [
  { id: 'angular', text: 'Angular' },
  { id: 'react', text: 'React' },
  { id: 'blazor', text: 'Blazor' },
];

public onRemove(event: IBaseChipEventArgs) {
  this.chips = this.chips.filter((chip) => chip.id !== event.owner.id);
}

Chips Area

Use the ChipsArea component to organize a collection of chips.

Inside the chips area, the arrow keys move focus between chips. When users drag a draggable chip over another chip, or press Shift and an arrow key, the chips area emits reorder with the new order. It also emits selectionChange with the selected chips. The chips area doesn’t reorder the chips itself, so apply the new order to your data in the reorder handler.

<igx-chips-area (reorder)="onReorder($event)">
  @for (chip of chips; track chip.id) {
    <igx-chip [id]="chip.id" [draggable]="true">{{ chip.text }}</igx-chip>
  }
</igx-chips-area>
import { IChipsAreaReorderEventArgs } from 'igniteui-angular/chips';

public onReorder(event: IChipsAreaReorderEventArgs) {
  this.chips = event.chipsArray.map((chip) => this.chips.find((item) => item.id === chip.id)!);
}

Localization

The chip follows the language set through the global localization API, described in Localization. Set resourceStrings to override the accessible labels of the default select and remove icons for a single chip.

<igx-chip removable [resourceStrings]="{ igx_chip_remove: 'Remove tag' }">Design</igx-chip>

Do/Don’t

When using a Chip, the obround will automatically size itself to fit the content and you only need to adjust the size of the instance accordingly. If the Chip is used as an action trigger for related content, avoid using it in scenarios where there is only one available action, or for configurations presenting only one selectable option.

Three chips, Blue, Gray, and Green, offered together as a set of related optionsDoUse chips for grouped actions or a small set of related options.
A single Blue chip offered as the only optionDon’tAvoid using a chip for single actions or single choices.

Properties

The Angular Chip exposes properties for selection, removal, state, and appearance.

Name Type Default Description
animateOnRelease boolean true Animates a dragged chip back to its place when it’s released.
color string n/a Sets the chip background color.
data any n/a Stores data related to the chip.
disabled boolean false Disables the chip and hides the remove icon.
draggable boolean false Lets users drag the chip.
hideBaseOnDrag boolean true Hides the original chip while a copy of it is dragged.
id string generated Sets the chip id. A unique value is generated when it isn’t set.
outlined boolean false Renders the chip with the outlined style.
removable boolean false Shows the remove icon.
removeIcon TemplateRef n/a Replaces the default remove icon.
resourceStrings IChipResourceStrings n/a Sets custom strings for the built-in labels.
selectable boolean false Lets users toggle the selected state.
selected boolean false Sets the selected state. Supports two-way binding.
selectIcon TemplateRef n/a Replaces the default select icon.
tabIndex number 0 Sets the chip tabindex. Disabled chips aren’t focusable.
variant "primary" | "info" | "success" | "warning" | "danger" n/a Sets the predefined color variant.

The ChipsArea exposes properties for its size.

Name Type Default Description
width number n/a Sets the width of the chips area.
height number n/a Sets the height of the chips area.

Events

The Angular Chip emits events when users select or remove it.

Name Description
selectedChanging Emitted before the selected state changes. Set cancel to keep the current state. selected is the new state.
selectedChanged Emitted after the selected state changes.
remove Emitted when the user activates the remove icon or presses Delete on the chip.
chipClick Emitted when the chip is clicked. Set cancel to prevent the selection change.
keyDown Emitted when a key is pressed on the chip. Set cancel to skip the default keyboard handling.
moveStart Emitted when the user starts dragging the chip.
moveEnd Emitted when the dragged chip is released and its return animation ends.
dragEnter Emitted when a dragged chip enters this chip.
dragLeave Emitted when a dragged chip leaves this chip.
dragOver Emitted while a dragged chip is over this chip.
dragDrop Emitted when a dragged chip is dropped on this chip.

The ChipsArea emits events for the chips inside it.

Name Description
reorder Emitted with the new order in chipsArray when a chip should move to a new position.
selectionChange Emitted with the selected chips in newSelection when a chip is selected or deselected.
moveStart Emitted when the user starts dragging a chip in the area.
moveEnd Emitted when the user stops dragging a chip in the area.

Styling

Style the Angular Chip with its CSS variables for token-level changes, and with its CSS classes when you need to target a specific element.

Variable What it changes
--ig-chip-background Background of the default (not outlined) chip.
--ig-chip-text-color Text color of the default chip.
--ig-chip-outlined-background Background of the outlined chip.
--ig-chip-outlined-text-color Text color of the outlined chip.
--ig-chip-border-color Border color of the outlined chip.
--ig-chip-border-radius Corner radius of the chip.
--ig-chip-hover-background Background of the default chip on hover.
--ig-chip-focus-background Background of the default chip on focus.
--ig-chip-focus-shadow-color Focus shadow color in the Bootstrap and Indigo themes.
--ig-chip-selected-background Background of a selected chip.
--ig-chip-selected-text-color Text color of a selected chip.
--ig-chip-disabled-background Background of a disabled chip.
--ig-chip-disabled-text-color Text color of a disabled chip.
--ig-chip-remove-icon-color Color of the remove icon.
--ig-chip-remove-icon-color-focus Color of the remove icon on focus.
--ig-chip-size Height of the chip.
--ig-size Shared component size token used to derive the chip size.
Selector Description
igx-chip The chip host element.
.igx-chip--outlined Applied when outlined is set.
.igx-chip--disabled Applied when disabled is set.
.igx-chip--primary Applied when variant is primary. The info, success, warning, and danger variants use the matching modifier.
.igx-chip__item The chip wrapper.
.igx-chip__item--selected Applied to the wrapper while the chip is selected.
.igx-chip__start The container for the select icon and the prefix content.
.igx-chip__content The container for the label.
.igx-chip__end The container for the suffix content and the remove control.
.igx-chip__remove The remove control.

Sass Theming

Use the chip-theme function when your application customizes Ignite UI themes through Sass. Set $background, or $outlined-background for outlined chips, and the theme derives the text, hover, focus, and selected colors from it. Override any other parameter when you need a specific value.

@use "igniteui-angular/theming" as *;

$custom-chip-theme: chip-theme(
  $background: #011627,
  $remove-icon-color: #fecc47
);

:root {
  @include tokens($custom-chip-theme);
}

CSS Variables

Set the chip CSS variables directly when you need local styling without a Sass build step. Set them on a chip, or on a container to style all chips inside it.

.filter-chips {
  --ig-chip-background: var(--ig-primary-500);
  --ig-chip-text-color: var(--ig-primary-500-contrast);
  --ig-chip-remove-icon-color: var(--ig-primary-500-contrast);
}

To style a single element of the chip, target its CSS class.

igx-chip .igx-chip__end {
  color: var(--ig-gray-400);
}

Styling with Tailwind

You can style the Angular Chip with Tailwind utility classes, and set its CSS variables through arbitrary properties such as [--ig-chip-background:var(--ig-primary-600)]. Make sure to set up Tailwind first, as described in Tailwind Classes.

Accessibility

The Angular Chip supports keyboard operation and exposes its state to assistive technology.

Keyboard Interaction

Keyboard users reach each chip with Tab, followed by its remove control when the chip is removable. Disabled chips are skipped.

Key Action
Space On the chip, toggles selected when selectable is set.
Space / Enter On the remove control, emits remove.
Delete On a removable chip, emits remove.
Arrow Left / Arrow Right Inside an igx-chips-area, moves focus to the previous or next chip.
Shift + Arrow Left / Arrow Right Inside an igx-chips-area, emits reorder with the focused chip moved one position.

Screen Readers / ARIA

The Angular Chip exposes its state through native semantics and ARIA attributes, and takes its accessible name from its content.

  • The chip host has role="option", and aria-selected reflects the selected state.
  • The igx-chips-area element has role="listbox" and the aria-label “chip area”.
  • The default select and remove icons have accessible labels.
  • A disabled chip is removed from the tab order, but no ARIA attribute exposes its disabled state.

You can change the labels of the default icons, as shown in Localization.

Accessibility Compliance

Infragistics documents Ignite UI for Angular accessibility support for Section 508 and WCAG 2.1 guideline areas in the Accessibility Compliance topic.

Criterion How the component complies
1.4.1 Use of Color A selected chip shows the select icon in addition to its selected colors.
2.1.1 Keyboard Selection, removal, and reordering inside a chips area work from the keyboard.
2.1.2 No Keyboard Trap The chip handles its own keys but never intercepts Tab, so focus can always leave it.
2.4.3 Focus Order Inside a chips area, the arrow keys move focus between chips in their visual order.
2.4.7 Focus Visible The focused chip shows a focus background, plus a focus shadow in the Bootstrap and Indigo themes.
4.1.2 Name, Role, Value The chip exposes the option role and its selected state, and the chips area exposes the listbox role.

Your responsibilities:

  • Give every chip a text label that identifies the item it represents.

  • Move focus to a logical place, such as the next chip, after you remove a chip in the remove event handler.

  • Keep sufficient contrast between the chip background and its text and icons when you override the theme colors.

  • Keep a visible focus indicator when you restyle the chip.

  • Keep chips and their remove controls large enough to tap when you use the small size or a custom --ig-chip-size.

  • Place chips that users select inside an igx-chips-area, so their option role has a listbox parent.

  • Label custom select and remove icon templates, as described in Layout.

Known exceptions:

  • The remove control is focusable and contains a labeled icon, but it doesn’t expose a button role.
  • The disabled state isn’t exposed through ARIA, so screen readers don’t announce a disabled chip as disabled. Describe the state in nearby text when users need to know it.

Troubleshooting

Use this section when a chip doesn’t behave or look as expected after a change or an upgrade.

Why does the chip stay on the page after I click the remove icon?

The remove event only notifies your application. Remove the chip in the event handler, as shown in Remove Chip.

Why doesn’t my focus outline variable apply anymore?

In igniteui-angular 22.2.0, the $focus-outline-color and $focus-selected-outline-color parameters of chip-theme were replaced by $focus-shadow-color and $focus-selected-shadow-color. Rename the parameters, and the matching --ig-chip-* variables, in your styles.

API References

Dependencies

The Angular Chip renders its default select and remove icons with the Icon component, which is included with the chip.

Icons that use Material Icons names, such as <igx-icon>person</igx-icon>, require the Material Icons font. Add <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> to your index.html. The Sass styling workflow uses the chip-theme and icon-theme functions.

Additional Resources

Use these resources for support and related Ignite UI for Angular documentation.

Use these related components when a chip isn’t the best match for the interaction.

  • Button - A control that runs a command, such as submitting a form or opening a dialog.
  • Checkbox - A form control for an on/off choice or a set of independent choices.
  • Badge - A small, non-interactive indicator for a status, count, or notification.

FAQ

When should I use a Chip instead of a Button?

A Ignite UI for Angular Chip represents an item, such as a tag, filter, or recipient, that users can select or remove. A Button runs a single command, so choose it when users trigger an action rather than pick or dismiss an item.

How do I allow only one selected chip at a time?

Handle the selection event of each Ignite UI for Angular Chip in the group. When a chip becomes selected, set selected to false on the other chips.

Can I replace the Chip's remove icon?

Yes. Pass a template to the removeIcon input of the Ignite UI for Angular Chip, and give the icon in it an accessible label, because it replaces the labeled default icon.

Can users reorder chips?

Yes. Users can drag draggable chips, or press Shift and an arrow key, inside an igx-chips-area. The Ignite UI for Angular chips area reports the new order, and your application applies it.

How do I change the size of the Chip?

Assign one of the shared size tokens, var(--ig-size-small), var(--ig-size-medium), or var(--ig-size-large), to the --ig-size CSS variable of the Ignite UI for Angular Chip.