# KptSwitchGroup (kpt-switch-group) A group of switches. Single choice by default (mutually exclusive) - turning one on turns the others off. With `multiple` it switches to multi-select mode (the value is an array of the selected options). Built on Signal Forms (`FormValueControl`, the `value` model). Import: `import { KptSwitchGroup } from '@konce-pt/angular';` ## Usage ## Inputs - `value`: model - single: the option's value or `null`; multiple: an array of the selected options' values. - `options`: KptOption[] - the list of options. - `multiple`: boolean (default false) - multi-select mode; the value becomes a `T[]` array. - `orientation`: 'vertical' (default) | 'horizontal'. - `allowDeselect`: boolean (default true) - whether clicking the active option deselects it (single mode only; in multiple mode deselection is always allowed). - `disabled`/`invalid`/`touched`: boolean; the `touch` output. ## How it works Every entry is a `kpt-switch` with a one-way `[checked]`. In single mode turning one on sets `value` to that option, which switches the others off automatically. In `multiple` mode the value is normalized to an array - turning one on adds the option's value, turning it off removes it. It renders `kpt-switch`, so it inherits its look and tokens. ## Screen reader and keyboard `aria-invalid` is not supported on `role="group"`, so the error state is carried by each switch. In single mode the switches are mutually exclusive and nothing announces that turning one on turned another off - for a single choice prefer `kpt-radio-group`. ## Label and description `id` goes to the focusable element - the host never carries it; without one it is generated. A `div` with a role is not named by `label[for]`, so inside `kpt-form-field` it gets `aria-labelledby` pointing at the wrapper's label (unless `ariaLabel` is set), and the hint or error is added to `aria-describedby`. No `controlId` needed. New: `id` and `ariaLabel` on the `group`. ## Read-only and required `readonly` is passed to every switch. With `allowDeselect=false` turning the active switch off puts it back on - before, the switch looked off while the group value said it was on.