v1.6.x-dev NDS IQ v6

Chips - National Design System

Interactive elements for selections, filtering, and categorization

Standard

Two color variants across all interaction states

<button class="nds-chip nds-primary nds-rounded"> <span class="nds-label">Label</span> </button>

With Icons

Leading and trailing icons are positioned with nds-lead-icon or nds-trail-icon on the chip

<!-- Leading icon --> <button class="nds-chip nds-primary nds-rounded nds-lead-icon"> <i class="hgi hgi-stroke hgi-add-01"></i> <span class="nds-label">Lead Icon</span> </button> <!-- Trailing icon --> <button class="nds-chip nds-neutral nds-rounded nds-trail-icon"> <span class="nds-label">Trail Icon</span> <i class="hgi hgi-stroke hgi-add-01"></i> </button>

Chip Group

Wrap multiple chips for consistent spacing and flow layout

<div class="nds-chips"> <button class="nds-chip nds-primary nds-rounded" data-state="selected"> <span class="nds-label">All</span> </button> <button class="nds-chip nds-neutral nds-rounded"> <span class="nds-label">Category A</span> </button> <button class="nds-chip nds-neutral nds-rounded"> <span class="nds-label">Category B</span> </button> </div>

Built-in Features

Pure CSS

No JavaScript required. All variants, sizes, and states render from HTML markup.

Interactive States

Hover, pressed, selected, focused, and disabled with focus-visible ring.

Label Truncation

Labels auto-truncate with ellipsis, configurable via --truncate.

Composable

Combine with icons, rounded shape, on-color variant, and chip groups.

Usage Guidelines

Best Practices

  • Use chips for interactive selections like filters, categories, and multi-select options
  • Use primary for emphasis and neutral for standard options. Selected state is handled by the selected class
  • For non-interactive labels and metadata display, use tags instead
  • Group related chips together for filter bars, category selectors, and multi-select inputs
  • Add leading icons when the chip represents a category with a recognizable symbol

Modifier Classes

nds-green is an alias for nds-primary, and nds-gray is an alias for nds-neutral.

ClassDescription
nds-primaryPrimary (green) color variant
nds-greenAlias for nds-primary
nds-neutralNeutral (gray) color variant
nds-grayAlias for nds-neutral
nds-roundedFully rounded pill shape (border-radius: 999px)
nds-oncolorOn-color variant for use on dark or brand-colored backgrounds
nds-smSmall size, 20px height
nds-mdMedium size, 24px height (default)
nds-lgLarge size, 32px height
nds-lead-iconApply to the chip when the first child is an icon; adds inline spacing after the icon
nds-trail-iconApply to the chip when the last child is an icon; adds inline spacing before the icon

CSS Custom Properties

PropertyDefaultDescription
--chip-bg--chip-background-neutral-defaultBackground color of the chip
--chip-text--chip-text-neutral-defaultText color of the chip
--chip-iconInherits --chip-textIcon color inside the chip
--chip-size24pxHeight of the chip (overridden by size modifiers)
--truncate1Number of lines before label text truncates with ellipsis
Last Modified Date: 28/06/2026 - 01:27 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks