Overview

tng-button-toggle is a segmented control that implements ControlValueAccessor. You supply options (value, label, optional disabled). It supports single or multiple selection and optional allowDeselect. Form value is the selected value(s): T | null (single) or T[] (multiple).

CVA options single / multiple Slot hooks Standalone
Reactive Forms

Quick example

Basic (single)
HTMLTSCSS

<form [formGroup]="form">
  <tng-button-toggle formControlName="view" [options]="viewOptions" />
</form>

Selected: list

Features

options

Array of { value, label, disabled? }. value is string | number.

multiple / allowDeselect

[multiple]="true" for multi-select; allowDeselect lets the user clear the selection.

Slot hooks

slot: container, button, buttonActive, buttonInactive, buttonDisabled.