# Chip group (Notchset): prompt.md (v2.0.0)

- id: `chip-group` · version 2.0.0 · component · pro (Pro)
- category: Selects and pickers
- build: one set of files for every shadcn style
- install: `npx shadcn@latest add @notchset-pro/chip-group`
- npm dependencies: lucide-react@^1
- registry dependencies: utils, https://notchset.dev/r/notchset-foundation.json, @notchset/menu, @notchset-pro/orb
- docs: https://notchset.dev/components/chip-group
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

Pills that pick what applies: tags (tonal, the check slot opening as the check draws), a pick-one filter (solid ink, counts in a fixed slot), Scout's dashed suggestions accepted in one press. "+N more" unfolds in place; a new chip grows in as the rest glide; loading reads in from bones..

## Build it
- Stack: React 18.3 or 19, TypeScript, Tailwind CSS v4 utility classes on the foundation's roles, a components.json (imports use its aliases).
- Packages: `lucide-react@^1` beyond `react` and `react-dom`.
- Files: `components/ui/notchset/chip-group.tsx`, `components/ui/notchset/pick-chip-parts.tsx`; shared code: `lib/notchset/button-move.ts`, `lib/notchset/controllable.ts`, `lib/notchset/count.ts`, `lib/notchset/icons.ts`, `lib/notchset/motion.ts`, `lib/notchset/words.ts`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `notchset-foundation`, `menu`, `orb`.
- Builds: one set of files, the same for every shadcn style.
- Exports to keep: `CHIP_GROUP_LABELS`, `ChipGroup`, `PickChip`, `foldAway`, and every exported type.
- CSS: the install adds the notchset foundation (its roles, keyframes and motion switch, reading your shadcn tokens for colour) to your global stylesheet once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Colours: every part reads the foundation's roles (`--ns-canvas`, `--ns-ink`, `--ns-line`, `--ns-signal` …), which read your shadcn tokens (`--background`, `--foreground`, `--border`, `--destructive` …), plus the optional `--success` and `--warning`. Retheme on `:root` or any container; never add Tailwind colour classes inside the component.
- This item reads `--ns-btn-roll`, `--ns-btn-tick`, `--ns-chip-pick`, `--ns-ease-arrive`, `--ns-ease-move`, `--ns-font-body`, `--ns-hit`, `--ns-hover`, `--ns-ink`, `--ns-ink-3`, `--ns-line`, `--ns-panel`, `--ns-pick-slot`, `--ns-radius-pill`, `--ns-raised`, `--ns-signal`, `--ns-time-color`, `--ns-weight-medium`, `--ns-well`.
- Retune it (on any ancestor) with the foundation's roles and hooks: `--ns-agent-b`, `--ns-agent-c`, `--ns-agent-d`, `--ns-agent-drift`, `--ns-agent-fill`, `--ns-agent-h1`, `--ns-agent-h2`, `--ns-agent-h3`, `--ns-agent-shift`, `--ns-avatar-card`, `--ns-avatar-lg`, `--ns-avatar-md`, `--ns-avatar-sm`, `--ns-avatar-xs`, `--ns-bad`, `--ns-bad-ink`, `--ns-band`, `--ns-band-edge`, `--ns-band-grade`, `--ns-band-optimal`, `--ns-banner-beat`, `--ns-banner-radius`, `--ns-beat`, `--ns-beat-ease`, `--ns-bezel`, `--ns-bloom-close`, `--ns-bloom-open`, `--ns-bloom-rise`, `--ns-btn-bad`, `--ns-btn-bad-hover`, `--ns-btn-bad-line`, `--ns-btn-bezel`, `--ns-btn-chosen`, `--ns-btn-gone`, `--ns-btn-morph`, `--ns-btn-ok`, `--ns-btn-press`, `--ns-btn-release`, `--ns-btn-result`, `--ns-btn-roll`, `--ns-btn-stagger`, `--ns-btn-stagger-step`, `--ns-btn-tick`, `--ns-btn-tonal`, `--ns-btn-tonal-edge`, `--ns-btn-tonal-hover`, `--ns-bulk-clear`, `--ns-button`, `--ns-button-field-inset`, `--ns-button-lg`, `--ns-button-sm`, `--ns-canvas`, `--ns-card-tilt`, `--ns-cat-1`, `--ns-cat-2`, `--ns-cat-3`, `--ns-cat-4`, `--ns-cat-5`, `--ns-cat-6`, `--ns-check`, `--ns-check-round`, `--ns-cheer-1`, `--ns-cheer-2`, `--ns-cheer-3`, `--ns-cheer-edge`, `--ns-cheer-fold`, `--ns-cheer-glow`, `--ns-cheer-lift`, `--ns-chip`, `--ns-chip-pick`, `--ns-control`, `--ns-control-lg`, `--ns-control-pad`, `--ns-control-sm`, `--ns-corner`, `--ns-danger`, `--ns-deep`, `--ns-deep-ink`, `--ns-deep-ink-2`, `--ns-deep-line`, `--ns-depth-card`, `--ns-depth-lift`, `--ns-depth-surface`, `--ns-dialog`, `--ns-dialog-grow`, `--ns-dialog-lg`, `--ns-dialog-max`, `--ns-dialog-shrink`, `--ns-dialog-sm`, `--ns-dialog-top`, `--ns-dock-bottom`, `--ns-drop`, `--ns-ease`, `--ns-ease-arrive`, `--ns-ease-breathe`, `--ns-ease-drum`, `--ns-ease-exit`, `--ns-ease-fling`, `--ns-ease-glide`, `--ns-ease-grow`, `--ns-ease-move`, `--ns-ease-panel`, `--ns-ease-pop`, `--ns-ease-press`, `--ns-ease-spring`, `--ns-ebg-arm`, `--ns-ebg-lit`, `--ns-emoji`, `--ns-emoji-md`, `--ns-emoji-sm`, `--ns-field`, `--ns-field-edge`, `--ns-field-h`, `--ns-fill`, `--ns-fill-time`, `--ns-flood-arc`, `--ns-flood-aurora`, `--ns-flood-behind-1`, `--ns-flood-behind-2`, `--ns-flood-bloom`, `--ns-flood-deep`, `--ns-flood-dial-bloom`, `--ns-flood-glass`, `--ns-flood-grain`, `--ns-flood-image`, `--ns-flood-ink`, `--ns-flood-ink-low`, `--ns-flood-light`, `--ns-flood-mid`, `--ns-flood-pale`, `--ns-flood-pane`, `--ns-flood-pane-edge`, `--ns-flood-pill-ink`, `--ns-flood-ribbon`, `--ns-flood-ribbon-core`, `--ns-flood-shadow`, `--ns-flood-sheen`, `--ns-flood-wash`, `--ns-font-body`, `--ns-font-display`, `--ns-font-mono`, `--ns-font-script`, `--ns-glass`, `--ns-glass-blur`, `--ns-glass-shadow`, `--ns-glow`, `--ns-glyph-pad`, `--ns-grain`, `--ns-gutter`, `--ns-header`, `--ns-help-max`, `--ns-hit`, `--ns-hover`, `--ns-icon`, `--ns-icon-lg`, `--ns-icon-sm`, `--ns-icon-stroke`, `--ns-info`, `--ns-info-ink`, `--ns-ink`, `--ns-ink-2`, `--ns-ink-3`, `--ns-ink-4`, `--ns-layer-bar`, `--ns-layer-modal`, `--ns-layer-panel`, `--ns-layer-popup`, `--ns-layer-sticky`, `--ns-layer-tip`, `--ns-layer-toast`, `--ns-layer-zoom`, `--ns-lead-body`, `--ns-lead-figure`, `--ns-lead-large`, `--ns-lead-meta`, `--ns-lead-small`, `--ns-lead-sub`, `--ns-lead-title`, `--ns-leading`, `--ns-leading-prose`, `--ns-leading-title`, `--ns-lift`, `--ns-light-1`, `--ns-light-2`, `--ns-light-3`, `--ns-light-spread`, `--ns-light-strength`, `--ns-line`, `--ns-line-soft`, `--ns-lit-edge`, `--ns-map-grass`, `--ns-map-water`, `--ns-mark-edge`, `--ns-mark-lifted`, `--ns-mark-rest`, `--ns-mark-swap`, `--ns-marker`, `--ns-marker-ink`, `--ns-mc-place`, `--ns-mc-roll`, `--ns-measure`, `--ns-menu-dy`, `--ns-menu-lit`, `--ns-menu-pad`, `--ns-menu-row`, `--ns-menu-rule`, `--ns-mesh`, `--ns-mesh-frost`, `--ns-nest-inset`, `--ns-nest-outer`, `--ns-nest-r`, `--ns-notch-ease`, `--ns-ok`, `--ns-ok-ink`, `--ns-on-fill`, `--ns-orb-body`, `--ns-orb-cool`, `--ns-orb-core`, `--ns-orb-dawn`, `--ns-orb-deep`, `--ns-orb-edge`, `--ns-orb-grain`, `--ns-orb-ground`, `--ns-orb-halo`, `--ns-orb-inner`, `--ns-orb-key`, `--ns-orb-lift`, `--ns-orb-limb`, `--ns-orb-limb-from`, `--ns-orb-rim`, `--ns-orb-skin-hi`, `--ns-orb-skin-lo`, `--ns-orb-skin-mid`, `--ns-orb-warm`, `--ns-palette-min`, `--ns-panel`, `--ns-panel-room`, `--ns-panel-w`, `--ns-panel-w-lg`, `--ns-pick-slot`, `--ns-pill-prop`, `--ns-play-fill`, `--ns-play-fill-color`, `--ns-play-lift`, `--ns-play-lift-y`, `--ns-play-open`, `--ns-play-open-content`, `--ns-play-press`, `--ns-play-press-box`, `--ns-play-reduced`, `--ns-play-ring`, `--ns-play-roll`, `--ns-play-shake`, `--ns-play-spring`, `--ns-play-swap`, `--ns-play-swap-blur`, `--ns-press-min`, `--ns-press-scale`, `--ns-press-x`, `--ns-press-y`, `--ns-primary-hover`, `--ns-primary-press`, `--ns-prism-edge`, `--ns-prism-glint`, `--ns-prism-sheen`, `--ns-prism-tint`, `--ns-pulse`, `--ns-radius`, `--ns-radius-2xl`, `--ns-radius-button`, `--ns-radius-button-lg`, `--ns-radius-button-sm`, `--ns-radius-card`, `--ns-radius-check`, `--ns-radius-control`, `--ns-radius-control-sm`, `--ns-radius-float`, `--ns-radius-full`, `--ns-radius-lg`, `--ns-radius-mark`, `--ns-radius-menu-row`, `--ns-radius-modal`, `--ns-radius-pill`, `--ns-radius-sm`, `--ns-radius-xl`, `--ns-radius-xs`, `--ns-raised`, `--ns-ramp-1`, `--ns-ramp-2`, `--ns-ramp-3`, `--ns-ramp-4`, `--ns-ramp-5`, `--ns-ramp-shine`, `--ns-range`, `--ns-rest-1`, `--ns-rest-2`, `--ns-rest-3`, `--ns-rise`, `--ns-row`, `--ns-row-compact`, `--ns-row-hue`, `--ns-scrim`, `--ns-search-h`, `--ns-segment`, `--ns-segment-inset`, `--ns-segment-lift`, `--ns-segment-sm`, `--ns-selected`, `--ns-series`, `--ns-series-core`, `--ns-series-glint`, `--ns-series-tint`, `--ns-shadow-dialog`, `--ns-shadow-float`, `--ns-shadow-lift`, `--ns-shadow-panel`, `--ns-sheet`, `--ns-sheet-back`, `--ns-sheet-bottom`, `--ns-sheet-drop`, `--ns-sheet-rise`, `--ns-shift`, `--ns-side`, `--ns-signal`, `--ns-signal-ink`, `--ns-signal-wash`, `--ns-sk-figure`, `--ns-sk-land`, `--ns-sk-p`, `--ns-sk-p0`, `--ns-sk-p1`, `--ns-sk-p2`, `--ns-sk-p3`, `--ns-sk-p4`, `--ns-sk-p5`, `--ns-sk-p6`, `--ns-sk-p7`, `--ns-sk-read`, `--ns-sk-sweep`, `--ns-skeleton`, `--ns-skeleton-bone`, `--ns-skeleton-bone-light`, `--ns-skeleton-light`, `--ns-slab`, `--ns-slab-edge`, `--ns-slab-ink`, `--ns-sleep-awake`, `--ns-sleep-deep`, `--ns-sleep-light`, `--ns-sleep-rem`, `--ns-space-1`, `--ns-space-2`, `--ns-space-3`, `--ns-space-4`, `--ns-space-5`, `--ns-space-6`, `--ns-space-8`, `--ns-space-section`, `--ns-stack-fan`, `--ns-stack-fan-gap`, `--ns-stack-fan-lag`, `--ns-stack-on`, `--ns-stagger-item`, `--ns-stagger-mark`, `--ns-stagger-max`, `--ns-standing-critical`, `--ns-standing-in`, `--ns-standing-out`, `--ns-state-doing`, `--ns-state-done`, `--ns-state-review`, `--ns-state-todo`, `--ns-step`, `--ns-step-from`, `--ns-step-sign`, `--ns-swipe-surface`, `--ns-switch-h`, `--ns-switch-w`, `--ns-text-body`, `--ns-text-control`, `--ns-text-control-lg`, `--ns-text-display`, `--ns-text-editorial`, `--ns-text-empty`, `--ns-text-figure`, `--ns-text-giant`, `--ns-text-heading`, `--ns-text-headline`, `--ns-text-input`, `--ns-text-large`, `--ns-text-lede`, `--ns-text-meta`, `--ns-text-record`, `--ns-text-sentence`, `--ns-text-small`, `--ns-text-sub`, `--ns-text-title`, `--ns-theme-fade`, `--ns-tile-shadow`, `--ns-time-born`, `--ns-time-color`, `--ns-time-confirm`, `--ns-time-dialog`, `--ns-time-fling`, `--ns-time-flip`, `--ns-time-glide`, `--ns-time-grow`, `--ns-time-hold`, `--ns-time-menu`, `--ns-time-page`, `--ns-time-panel`, `--ns-time-quick`, `--ns-time-roll`, `--ns-time-settle`, `--ns-time-snap`, `--ns-time-spin`, `--ns-time-spring`, `--ns-time-sweep`, `--ns-time-toast`, `--ns-tint`, `--ns-tint-c`, `--ns-tint-ease`, `--ns-tint-fill`, `--ns-tint-gap`, `--ns-tint-h1`, `--ns-tint-h2`, `--ns-tint-h3`, `--ns-tint-ink`, `--ns-tint-row`, `--ns-tip-fold`, `--ns-tip-grow`, `--ns-toast-bottom`, `--ns-toast-gap`, `--ns-toast-left`, `--ns-toast-lift`, `--ns-toast-peek`, `--ns-toast-scale`, `--ns-toast-w`, `--ns-touch`, `--ns-tracking-body`, `--ns-tracking-caps`, `--ns-tracking-control`, `--ns-tracking-display`, `--ns-tracking-headline`, `--ns-tracking-sub`, `--ns-tracking-title`, `--ns-warn`, `--ns-warn-ink`, `--ns-wash-clay`, `--ns-wash-dusk`, `--ns-wash-graphite`, `--ns-wash-ink`, `--ns-wash-sage`, `--ns-wash-sand`, `--ns-weight-light`, `--ns-weight-medium`, `--ns-weight-regular`, `--ns-weight-strong`, `--ns-well`, `--ns-width-lg`, `--ns-width-md`, `--ns-width-sm`, `--ns-width-xl`.
- Never add Tailwind colour classes inside the component.

```tsx
import { ChipGroup, type ChipOption } from "@/components/ui/notchset/chip-group";
```

## Parts
- A single export that takes props.

## Match the original
- Read `components/ui/notchset/chip-group.tsx`, `components/ui/notchset/pick-chip-parts.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- A few filters or tags chosen from one short list that stays in view.

### Not when
- One view of several, always one, is SegmentedControl; a form's single choice with detail is RadioCards; a long list is Combobox or FilterButton.

## Built from
- menu (`menu`), installed with it: reuse it, don't rebuild it
- orb (`orb`), installed with it: reuse it, don't rebuild it
- Button move (shared helper, ships with it)
- Controllable (shared helper, ships with it)
- Count (shared helper, ships with it)
- Icons (shared helper, ships with it)
- Motion (shared helper, ships with it)
- Words (shared helper, ships with it)

## Mistakes
- Using it for one view of several that is always one: that is SegmentedControl
- Writing the count into the label: pass count, so it sits in quiet ink and formats
- Leaving none chosen where the list needs one: set required

## Usage

```tsx
"use client";
import * as React from "react";
import { ButtonRoll } from "@/lib/notchset/button-look";
import { ChipGroup, type ChipOption } from "@/components/ui/notchset/chip-group";
import { useLessMotion } from "@/lib/notchset/motion";
import { Orb } from "@/components/ui/notchset/orb";
import { RollingNumber } from "@/components/ui/notchset/rolling-number";
import { pressIn, useSelfPlay } from "./self-play";

/*
 * The group alone, centred, in three looks. Tags: Enterprise is on; a press picks another (it widens as its check
 * draws), "+5 more" unfolds the rest in the row and "Less" folds them back; on arrival Renewal is picked. Filter: one
 * stage at a time, solid ink, its count in a fixed slot, the line under it rolling; on arrival Proposal is picked.
 * Suggested: Scout's two suggestions arrive dashed and the first is added; a press adds one, the x dismisses it; with
 * none left, Ask Scout brings the next beside Renewal and the tags after it make room.
 */
type Look = "tags" | "filter" | "suggested";

const TAGS: ChipOption<string>[] = [
  { value: "enterprise", label: "Enterprise" },
  { value: "eu", label: "EU" },
  { value: "renewal", label: "Renewal" },
  { value: "expansion", label: "Expansion" },
  { value: "fintech", label: "Fintech" },
  { value: "champion", label: "Champion" },
  { value: "security", label: "Security review" },
  { value: "q1", label: "Q1 close" },
  { value: "annual", label: "Annual plan" },
];
const STAGES: ChipOption<string>[] = [
  { value: "lead", label: "Lead", count: 9 },
  { value: "qualified", label: "Qualified", count: 6 },
  { value: "proposal", label: "Proposal", count: 12 },
  { value: "won", label: "Won", count: 4 },
];
const SUGGESTIONS: ChipOption<string>[] = [
  { value: "expansion", label: "Expansion", suggested: true },
  { value: "security", label: "Security review", suggested: true },
];
const NEXT: ChipOption<string>[] = [
  { value: "annual", label: "Annual plan", suggested: true },
  { value: "q1", label: "Q1 close", suggested: true },
];
const LINE = "mt-4 flex h-4 items-center justify-center gap-1.5 text-[length:var(--ns-text-meta)] leading-[15px] text-[var(--ns-ink-3)]";
const CHIP = "[data-chip] > button";

/* plays once on arrival: each look's own moment, pressing its own chips */
function usePlay(beats: number[], run: (step: number, root: HTMLElement | null) => void) {
  const root = React.useRef<HTMLDivElement>(null);
  const play = useSelfPlay(root, { beats, off: useLessMotion() });
  React.useEffect(() => {
    if (play.step < 0) return;
    const step = play.step;
    const t = setTimeout(() => run(step, root.current));
    return () => clearTimeout(t);
    // eslint-disable-next-line react-hooks/exhaustive-deps -- once per step
  }, [play.step, play.taken]);
  return { root, hand: { onPointerDownCapture: play.handOver, onKeyDownCapture: play.handOver } };
}

function Tags() {
  const [value, setValue] = React.useState(["enterprise"]);
  const options = TAGS;
  const { root, hand } = usePlay([0], (_, el) => pressIn(el, `${CHIP}:not([aria-pressed=true])`, "Renewal"));
  return (
    <div ref={root} {...hand} className="flex w-full flex-col items-center">
      <ChipGroup multiple label="Tags" options={options} value={value} onValueChange={setValue} max={4} more="unfold" className="justify-center" />
    </div>
  );
}

function Filter() {
  const [value, setValue] = React.useState<string | null>(null);
  const stages = STAGES;
  const on = stages.find((s) => s.value === value);
  const { root, hand } = usePlay([0], (_, el) => [...(el?.querySelectorAll<HTMLElement>(CHIP) ?? [])].find((b) => b.textContent?.trim().startsWith("Proposal"))?.click());
  return (
    <div ref={root} {...hand} className="flex w-full flex-col items-center">
      <div data-swipe-off="" className="flex max-w-full justify-center">
        <ChipGroup label="Filter by stage" options={stages} value={value} onValueChange={setValue} row />
      </div>
      <div aria-live="polite" className={LINE}>
        <RollingNumber value={String(on?.count ?? stages.reduce((n, s) => n + (s.count ?? 0), 0))} />
        <ButtonRoll k={on?.value ?? "all"}>{on ? `deals in ${on.label}` : "deals"}</ButtonRoll>
      </div>
    </div>
  );
}

function Suggested() {
  const [options, setOptions] = React.useState(() => TAGS.slice(0, 3));
  const [value, setValue] = React.useState(["enterprise", "eu"]);
  /* Scout's two suggestions arrive, then the first is added */
  const { root, hand } = usePlay([0, 180, 1000], (step, el) => {
    const s = SUGGESTIONS[step];
    if (s) setOptions((xs) => (xs.some((x) => x.value === s.value) ? xs : [...xs, s]));
    else pressIn(el, CHIP, "Expansion");
  });
  const left = options.filter((o) => o.suggested).length;
  const next = NEXT.find((m) => !options.some((o) => o.value === m.value));
  return (
    <div ref={root} {...hand} className="flex w-full flex-col items-center">
      <ChipGroup
        multiple
        label="Tags"
        options={options}
        value={value}
        onValueChange={setValue}
        className="justify-center"
        onAccept={(id) => {
          setOptions((xs) => xs.map((x) => (x.value === id ? { ...x, suggested: false } : x)));
          setValue((v) => [...v, id]);
        }}
        onDismiss={(id) => setOptions((xs) => xs.filter((x) => x.value !== id))}
      />
      <div aria-live="polite" className={LINE}>
        <ButtonRoll k={String(left)}>{left === 0 ? "Tags up to date" : left === 1 ? "Scout suggests one, from Tuesday's call" : "Scout suggests two, from Tuesday's call"}</ButtonRoll>
        {left === 0 && next ? (
          <button
            type="button"
            onClick={() =>
              setOptions((xs) => {
                const at = xs.findIndex((x) => x.value === "renewal") + 1;
                return at > 0 ? [...xs.slice(0, at), next, ...xs.slice(at)] : [...xs, next];
              })
            }
            className="ms-1 inline-flex h-6 cursor-pointer items-center gap-1.5 rounded-full px-2 text-[length:var(--ns-text-meta)] font-[number:var(--ns-weight-medium)] text-[var(--ns-ink-2)] outline-hidden transition-colors hover:bg-[var(--ns-hover)] hover:text-[var(--ns-ink)] focus-visible:outline-2 focus-visible:outline-[var(--ns-signal)] pointer-coarse:h-11"
          >
            <Orb size={12} word="none" live={false} tint="Scout" />
            Ask Scout
          </button>
        ) : null}
      </div>
    </div>
  );
}

export default function ChipGroupDemo() {
  const look = "tags" as Look;
  const Stage = { tags: Tags, filter: Filter, suggested: Suggested }[look] ?? Tags;
  /* one column for every look, its height held to the tallest, so the stage never changes height */
  return (
    <div className="flex min-h-[160px] w-[720px] max-w-full flex-col justify-center">
      <Stage key={look} />
    </div>
  );
}
```

This example also uses `button` (https://notchset.dev/components/button), `rolling-number` (https://notchset.dev/components/rolling-number). Installing this item doesn't bring them; to paste the example as it is: `npx shadcn@latest add @notchset-pro/chip-group @notchset/button @notchset/rolling-number`. The `@notchset-pro` items are Pro: they need the registries in components.json and the key (Setup).

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `options` | `ChipOption<V>[]` |  | Required. |
| `label` | `string` |  | Names the group for screen readers ("Due"). |
| `max` | `number` |  | how many chips show before the rest sit behind a "+N more" chip; every chip shows when it is left off or the list fits |
| `more` | `"menu" \| "unfold"` |  | what "+N more" does: open the rest as a menu (the default), or unfold them in the row, with "Less" to fold back |
| `row` | `boolean` |  | one line that scrolls sideways, its ends fading, instead of wrapping |
| `loading` | `boolean` |  | the loading form: each chip a bone of its own width; they read in left to right when it turns false |
| `onAccept` | `(value: V) => void` |  | a suggestion accepted (it becomes a tag: the host clears `suggested` and turns it on) |
| `onDismiss` | `(value: V) => void` |  | a suggestion dismissed (the host takes it out of `options`) |
| `agent` | `string` |  | the agent that makes the suggestions, named in their words and tinting its orb |
| `labels` | `Partial<ChipGroupLabels>` |  | its built-in words (CHIP_GROUP_LABELS), English by default |
| `locale` | `string` |  | how the counts are written (en-US by default, never the viewer's) |
| `multiple` | `true \| false` |  |  |
| `value` | `V[] \| V \| null` |  | the chips turned on (controlled), with onValueChange |
| `defaultValue` | `V[] \| V \| null` |  |  |
| `onValueChange` | `(value: V[]) => void \| (value: V \| null) => void` |  |  |
| `required` | `boolean` |  | one chip always stays on: pressing the chosen one does nothing |

Full docs: https://notchset.dev/components/chip-group

## Customising
- Colours: every part reads the foundation's roles (`--ns-canvas`, `--ns-ink`, `--ns-line`, `--ns-signal` …), which read your shadcn tokens (`--background`, `--foreground`, `--border`, `--destructive` …), plus the optional `--success` and `--warning`. Retheme on `:root` or any container; never add Tailwind colour classes inside the component.
- Dark mode follows the `.dark` class or `data-theme="dark"` on an ancestor (the shadcn and next-themes conventions).
- Update later: Commit or stash local changes first (or copy the files), so the update can be undone. Read https://notchset.dev/r/changelog.json for the new versions: a major version, an entry marked breaking or a merge says what to change. Then re-run the install with `--overwrite`, on a branch. It replaces the component's files, the shared helper files they import, and the item's CSS rules in the global stylesheet, so review the whole diff (components, shared files, CSS), re-apply your own edits, and run the app's typecheck, tests and build.

## Keyboard

| Keys | Action |
|---|---|
| ← → ↑ ↓ | move between the chips |
| Home End | the first or last chip |
| Space or Enter | turn the focused chip on or off |
| Tab | with `max`, on to the "+N more" chip, which opens the rest as a menu |

## Performance

- One button per option; it measures each chip once a render to glide the rest when one arrives.
- Two to twelve options is its scale.
- A longer list is a Combobox or a FilterButton.

## Responsive

- phone (each chip presses across 44px) and desktop
- dark (tokens)
- reduced motion: no movement to reduce

## Motion inventory

| Interaction | What moves |
|---|---|
| a picked chip's check draws | ns-tick-draw on --ns-btn-tick, --ns-ease-move, 60ms late. Reduced motion: the check is there at once (useLessMotion). |
| pick: the chip squashes, settles, and widens as its check slot opens and the check draws | squash 110ms, settle 380ms; slot width --ns-btn-roll on --ns-ease-move; check --ns-btn-tick. Reduced motion: the form and slot change at once, the check shown drawn. |
| a chip new to options grows in from its start; the rest glide to their places | 380ms on the arrival curve, 60ms apart; FLIP 360ms on --ns-ease-move (Web Animations, literal curves). Reduced motion: it is simply there. |
| "+N more" unfolds in place, 45ms apart | ns-chip-pop 340ms --ns-ease-arrive. Reduced motion: they appear. |
| a dismissed suggestion folds away | squash, then width to 0 and fade, 360ms (Web Animations, the exit curve). Reduced motion: removed at once. |
| loading: bones read into the chips left to right | opacity 320ms, 40ms apart. Reduced motion: the same fade. |

## Accessibility contract (preserve when editing)
- A named group with one tab stop; each chip is a toggle button with aria-pressed, and an option's description is read as its description.
- With `max`, the "+N more" chip is its own tab stop after the group: Tab reaches it, and it opens the rest as a menu.

## Install

```bash
# npm
npx shadcn@latest add @notchset-pro/chip-group
# pnpm
pnpm dlx shadcn@latest add @notchset-pro/chip-group
# yarn
yarn dlx shadcn@latest add @notchset-pro/chip-group
# bun
bunx --bun shadcn@latest add @notchset-pro/chip-group
```

Pro item: needs the `@notchset-pro` registry in `components.json` and `NOTCHSET_TOKEN` in `.env.local` (https://notchset.dev/account). Setup: https://notchset.dev/docs/pro. Every components.json `style` gets the same files.

### Manual

1. Install the packages: `npm install lucide-react@^1`.
2. Copy `components/ui/notchset/chip-group.tsx`, `lib/notchset/button-move.ts`, `lib/notchset/controllable.ts`, `lib/notchset/count.ts`, `lib/notchset/icons.ts`, `lib/notchset/motion.ts`, `components/ui/notchset/pick-chip-parts.tsx`, `lib/notchset/words.ts` from https://notchset.dev/r/pro/chip-group.json, sent with the header `Authorization: Bearer ${NOTCHSET_TOKEN}` (each file's `content`, at its `target`), keeping the `@/` path alias of your tsconfig.
3. Add what it builds on: shadcn `utils` (cn), `notchset-foundation`, `menu`, `orb`.

## Continue the workflow

- [Chip](https://notchset.dev/components/chip)
- [Color picker](https://notchset.dev/components/color-picker)
- [Combobox](https://notchset.dev/components/combobox)

The foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://notchset.dev/r/notchset-foundation.json.
