# KptButtonGroup (kpt-button-group) A segmented button group (toggle, single choice). Signal Forms. Import: `import { KptButtonGroup, KptOption } from '@konce-pt/angular';` ## Inputs - `options`: KptOption[]; `value`: model; `size`: 'sm'|'md'|'lg'; `disabled`/`invalid`/`touched`; `touch` - `iconOnly`: boolean - hides the labels and leaves the icons alone ## Icons An option carries its icon by name: `KptOption.icon` is a key from the icon registry, and the group renders it before the label. The item is a flex box, so the icon gets the `--kpt-button-gap` spacing and a size that follows `size` (1rem at `sm` up to 1.25rem at `lg`) - the same scale as `kpt-button`, so a group standing next to a button matches it. `iconOnly` drops the label from the page but keeps it as the accessible name: the item gets both `aria-label` and a `kptTooltip`, so a screen reader still says "Grid" and a mouse or keyboard user gets the library tooltip (not the native `title`, which ignores the theme and never shows on focus). Each item also becomes a square, because a lone icon inside a 1rem side padding looks adrift. The icon takes its colour from `currentColor`, so the active item - filled with `--kpt-color-primary` - flips the icon to `--kpt-color-on-primary` with no extra rule. ## Examples ## Motion The selection background slides from the previously selected option to the new one on a spring (a FLIP of the `::before` layer, `playIndicatorMotion` from `@konce-pt/motion`), the label colour crossfades, and a pressed option squeezes slightly. The slide follows `toggle` from `provideKptMotion` (`spring` only); `enabled: false` and the system "reduce motion" setting always win. ## Tokens `--kpt-color-primary`, `--kpt-color-border-strong`, `--kpt-color-muted`, `--kpt-button-gap`. ## Read-only and required The group is `role="radiogroup"` with `role="radio"` items (`aria-checked`) instead of `aria-pressed` buttons - the choice is exclusive, so a screen reader announces "2 of 3". One Tab stop, arrows move the selection, `Home`/`End` jump to the ends. New: `id`, `ariaLabel`, `readonly`, `required`, and the error state (`invalid` + `touched`) visible on the group itself.