Component v1.1.0 Foundations

Chip

Compact value token with optional selection, removal, variants, sizes, and disabled state.

API Stable 2.1 WCAG notes Ready Dark mode
Selector
ui-chip
Package
@ngnova/ui/chip

Import

Standalone Tailwind v4
import { UiChipComponent } from '@ngnova/ui/chip';

Usage & variants

Live examples use the public ui-chip API, paired with the exact snippet a product team would paste into an Angular app.

API Reference

Active component filters

Compact value token with optional selection, removal, variants, sizes, and disabled state.

AngularTypeScript

Production guidance

Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.

When to use

Use for applied filters, multi-select values, or compact entities users can toggle or remove.

Watch for

Long projected labels truncate within the available width while removal remains visible.

Product recipes

Apply Chip in distinct, copyable product scenarios—not just an isolated component state.

Selectable and removable filters

Selection and removal remain separate native buttons with distinct semantics.

Angular template ui-chip-recipe.example.html
1
2
3
4
<ui-chip selectable [(selected)]="selected">Angular</ui-chip>
<ui-chip removable removeAriaLabel="Remove TypeScript filter" (removed)="removeFilter()">
  TypeScript
</ui-chip>

Team member picker

Represent selected people as removable chips and return focus to the picker after removal.

Angular template ui-chip-recipe.example.html
1
2
3
4
5
6
7
<div class="flex flex-wrap gap-2" aria-label="Selected reviewers">
  @for (reviewer of reviewers(); track reviewer.id) {
    <ui-chip removable (removed)="removeReviewer(reviewer.id)">
      {{ reviewer.name }}
    </ui-chip>
  }
</div>

API Reference

Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.

Inputs

variant 'neutral'
'neutral' | 'primary' | 'success' | 'warning' | 'danger'

Semantic color treatment for the value.

size 'md'
'sm' | 'md'

Compact or standard chip height and typography.

selectable false
boolean

Renders a native toggle button with aria-pressed.

selected false
boolean

Controlled selected state for selectable chips.

removable false
boolean

Shows a separately focusable removal action.

disabled false
boolean

Disables both selection and removal controls.

removeAriaLabel 'Remove'
string

Localized accessible name for the removal action.

Outputs

selectedChange boolean

Requests a controlled selection-state update.

removed void

Requests removal without mutating the parent-owned collection.

Accessibility

  • Selectable chips use a native button and aria-pressed; removable chips expose a separate named button.
  • Use a specific localized removeAriaLabel that includes the value when several removable chips are present.
  • Disabled state applies to every interactive control in the chip.

Keyboard behavior

  • Tab reaches selection and removal controls independently.
  • Enter and Space use native button behavior for toggle and removal.

Testing guidance

  • Use UiChipHarness to locate by text, inspect and toggle selection, and activate removal.
  • Test every variant and size, disabled behavior, long labels, localized removal names, and parent collection updates.