Chip

Chips help people enter information, make selections, filter content, or trigger actions.

Chip — overview and usage

Chips are small interactive components that represent an action, a choice or a compact input. They follow Material 3 principles and come in four main usage types:

  • Assist (triggers a quick action, close to a button)
  • Filter (on/off or multi-selection)
  • Input (represents a value entered by the user, e.g. a tag)
  • Suggestion (offers contextual options)

This page explains how to use Chip in Udixio, with practical examples. The component code may evolve, but the concepts and best practices remain valid.

Installation and import

React:

tsx
import { Chip } from '@udixio/ui-react';

Angular:

ts
import { Chip } from '@udixio/ui-angular';

Svelte:

svelte
import { Chip } from '@udixio/ui-svelte';

Minimal example

The label is passed with label in all adapters. React also accepts a string via children; Svelte accepts a children snippet, while Angular uses the label input.

Usage types

Assist chip (quick action)

An assist chip triggers an immediate action: open a view, copy some text, apply a temporary filter, etc.

Filter chip (selection)

Make a chip selectable with selected and onSelectedChange in React, selected and selectedChange in Angular, or bind:selected in Svelte. For self-contained state, initialize it with defaultSelected.

Suggestion chip (proposal)

Present contextual suggestions (quick replies, search filters). Keep labels short (ideally ≤ 20 characters). Use outlined on a neutral background and elevated when extra visual separation is needed.

Input chip (entered value)

Represents user input (e.g. tags). Adding and removing is handled by your application logic.

Icon

You can display an icon from the Udixio catalog inside the chip. The Angular adapter does not require Font Awesome.

When href is provided, the component can behave as a link. Otherwise it acts as an interactive control (click/toggle).

States and accessibility

  • disabled makes the chip inactive.
  • Selectable chips expose aria-pressed automatically.
  • Keep a touch target of at least 48 dp and sufficient contrast for the theme.
Lien indisponible

Chips (list)

The Chips container component does not support a children mode. It only renders a list from items and notifies changes via onItemsChange in React, itemsChange in Angular, or onItemsChange/bind:items in Svelte.

The detailed contracts remain available separately in the Chip and Chips API references.

A stable application id is recommended, especially when items get reordered. Without an id, Chips keeps an internal identifier tied to the object in React and uses its position in Angular.

selected turns an item into a controlled filter. removable adds the remove action at the end of the chip. An item that declares neither capability stays a compact action. Use scrollable when horizontal scrolling is preferable to wrapping.

Editing (variant=“input”)

  • Double-click (or F2/Enter when the chip has focus and is not selectable) puts a chip into editing directly.
  • Editing is inline via contenteditable (no separate input field). Press Enter to commit, Escape to cancel, or blur to commit.
  • Committing an empty label on a removable chip removes the chip.
  • The existing shortcuts remain: Enter/Space for selection, Backspace/Delete for onRemove when the chip is selected and not being edited.

In React, holding focus for one second also starts editing. This deferred trigger does not exist in Angular; double-click, F2 and Enter remain common to both adapters.

With Chips variant="input", React additionally lets you click an empty area of the container to create a chip. Angular does not offer this creation shortcut yet: add the item in your application logic before editing it.