Import the public directives from the published package entrypoint.

chip.ts
import { KuiChip, KuiChipRemove } from '@kikita-labs/ui';

kuiChip applies to a span for a static, non-interactive chip, or to a button/a for an interactive chip. Chip represents a chosen value or removable filter; Badge represents status. See the Badge docs when you need a status marker instead.

DesignEngineeringShipped
<div class="basic-chip-example">
  <span kuiChip>Design</span>
  <span kuiChip appearance="primary">Engineering</span>
  <span kuiChip appearance="success">Shipped</span>
</div>

Set removable and listen for (removed) to drop a value from a collection. Provide removeLabel with a value-specific name so screen reader users know which chip a given remove button clears.

DesignEngineeringProduct
<div class="removable-chip-example">
  @for (tag of tags(); track tag) {
    <span
      kuiChip
      appearance="primary"
      removable
      [removeLabel]="'Remove ' + tag"
      (removed)="removeTag(tag)"
    >
      <span class="kui-chip-label">{{ tag }}</span>
    </span>
  }
</div>

Use a native button host when the chip itself toggles a filter or selection instead of only removing a value.

<div class="interactive-chip-example">
  <button
    kuiChip
    type="button"
    [appearance]="selected() === 'all' ? 'primary' : 'neutral'"
    (click)="select('all')"
  >
    All
  </button>
  <button
    kuiChip
    type="button"
    [appearance]="selected() === 'open' ? 'primary' : 'neutral'"
    (click)="select('open')"
  >
    Open
  </button>
  <button
    kuiChip
    type="button"
    [appearance]="selected() === 'closed' ? 'primary' : 'neutral'"
    (click)="select('closed')"
  >
    Closed
  </button>
</div>

disabled reduces opacity and makes the nested remove action inert. invalid shows the invalid border treatment.

DesignMissing owner
<div class="chip-states-example">
  <span kuiChip disabled>
    <span class="kui-chip-label">Design</span>
    <button kuiChipRemove type="button" aria-label="Remove Design"></button>
  </span>
  <span kuiChip invalid appearance="danger">Missing owner</span>
</div>

Set defaults.chip once for the application or for a subtree. Each option resolves as local input > defaults.chip.<option> > built-in default.

import { provideKikitaUi } from '@kikita-labs/ui';

export const appConfig: ApplicationConfig = {
  providers: [
    provideKikitaUi({
      defaults: {
        chip: {
          /* options below */
        },
      },
    }),
  ],
};
NameTypeDefaultDescription
size'xs' | 'sm' | 'md' | 'lg' — Component size. Takes precedence over the global defaults.size.
removeIconKuiIconGlyph — Icon of the remove button. Takes precedence over defaults.icons.remove. See Structural Icons.

Set any of these on the component or an ancestor to restyle one part. Each token is optional: when it is not set, the part uses the role or scale token in the default column.

NameTypeDefaultDescription
--kui-chip-bg-primary-hoverCSS custom property--kui-color-primary-soft-bg-hoverBackground, primary hover
--kui-chip-border-activeCSS custom property--kui-color-border-control-hoverBorder color, active
--kui-chip-border-focusCSS custom property--kui-color-focusBorder color, focus
--kui-chip-border-invalidCSS custom property--kui-color-danger-indicatorBorder color, invalid
--kui-chip-counter-colorCSS custom property--kui-color-text-secondaryCounter color
--kui-chip-focus-ring-colorCSS custom property--kui-color-focusFocus ring color
--kui-chip-remove-focus-ring-colorCSS custom property--kui-color-focusRemove focus ring color
NameTypeDefaultDescription
--kui-chip-padding-inline-end-removableCSS custom property--kui-space-1Padding, inline end removable
--kui-chip-padding-inline-xsCSS custom property--kui-space-1Padding, inline xs
--kui-chip-padding-inline-smCSS custom property--kui-space-2Padding, inline sm
--kui-chip-padding-inline-lgCSS custom property--kui-space-3Padding, inline lg
--kui-chip-avatar-radiusCSS custom property--kui-radius-fullAvatar corner radius
--kui-chip-counter-padding-inline-smCSS custom property--kui-space-2Counter padding, inline sm

Inputs and outputs verified against @kikita-labs/ui v2.0.0 public typings.

NameTypeDefaultDescription
appearance'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info''neutral'Semantic visual treatment mapped to Kikita UI status tokens.
size'xs' | 'sm' | 'md' | 'lg''md'Chip size. sm is the size used inside Select and Combobox controls. Falls back to defaults.chip.size, then the global defaults.size.
disabledbooleanfalseReduces opacity and makes the nested remove action inert.
invalidbooleanfalseShows the invalid border treatment.
removablebooleanfalseRenders a default remove button (crossmark icon) as the last child. Primary way to make a chip removable; use kuiChipRemove instead only for a custom icon or extra content.
removeLabelstring | undefined'Remove'Accessible name for the default remove button rendered by removable. Provide a value-specific label, for example "Remove Design".
removedoutput: void-Emitted when the default remove button or a nested button[kuiChipRemove] is activated.
kuiChipRemovedirective on button-Marks a native button as the chip remove action. Use only when the default removable button is not enough (custom icon, extra content); do not combine both on the same chip. Needs its own aria-label, for example "Remove Design".
--kui-chip-bgCSS color-Chip background color.
--kui-chip-bg-hoverCSS color-Chip background color on hover for interactive chips.
--kui-chip-borderCSS color-Chip border color.
--kui-chip-textCSS color-Chip label text color.
--kui-chip-radiusCSS length-Chip corner radius.
--kui-chip-height-xsCSS length-Chip block size for size="xs".
--kui-chip-height-smCSS length-Chip block size for size="sm".
--kui-chip-height-mdCSS length-Chip block size for size="md" (default).
--kui-chip-height-lgCSS length-Chip block size for size="lg".
--kui-chip-remove-colorCSS color-Remove icon color.
--kui-chip-remove-color-hoverCSS color-Remove icon color on hover.
--kui-chip-disabled-opacityCSS number-Opacity applied to the whole chip when disabled.
KuiChipOptionsinterface-Shape of defaults.chip: size and removeIcon (takes precedence over defaults.icons.remove).

Chip keeps native element semantics instead of adding ARIA roles.

  • Use a non-interactive host such as span for a static chip.
  • Use a native button or a for an interactive chip.
  • Prefer removable with a value-specific removeLabel, for example removeLabel="Remove Design". Use a projected button[kuiChipRemove] with its own accessible name only when the default button isn't enough; do not combine both on the same chip.
  • Disabled chips mark the remove button aria-disabled="true" and tabindex="-1".
  • Select and Combobox own keyboard behavior for Delete/Backspace selected-value removal; do not duplicate that handling when Chip is used inside those controls.

Consumer-visible changes of @kikita-labs/ui 2.0 for Chip.

  • The classes are KuiChip and KuiChipRemove (they had a Directive suffix); ng update @kikita-labs/ui renames the imports. kuiIconButton inside a chip is now KuiIconButton.
  • The size falls back to defaults.chip.size, and the remove icon to defaults.chip.removeIcon (then defaults.icons.remove). The remove mark is drawn by the shared structural icon renderer.
  • The disabled state dims to the shared 0.5 opacity (it was 0.4), the focus ring is a 2px outline, and a pressed chip keeps system colours in forced colors mode.