API reference
Underlying primitives
tngButtonToggleGroup and tngButtonToggle remain the behavioral baseline underneath the component wrapper. The group wrapper forwards that primitive contract from its host, so grouped items participate in the same focus and selection model as the headless pair.
Primitive attachment
html
<div
tngButtonToggleGroup
type="single"
[tngButtonToggleValue]="density()"
(valueChange)="onDensityChange($event)"
>
<button tngButtonToggle tngButtonToggleValue="compact">Compact</button>
<button tngButtonToggle tngButtonToggleValue="comfortable">Comfortable</button>
</div>
tng-button-toggle-group
The group wrapper hosts the primitive group behavior directly. That means selection mode, keyboard traversal, controlled values, and the analytics-focused outputs all come from the same contract you would use in headless composition.
Group attachment
html
<tng-button-toggle-group
ariaLabel="Density selection"
[value]="density()"
(valueChange)="onDensityChange($event)"
>
<tng-button-toggle [tngButtonToggleValue]="'compact'">Compact</tng-button-toggle>
<tng-button-toggle [tngButtonToggleValue]="'comfortable'">Comfortable</tng-button-toggle>
</tng-button-toggle-group>
tng-button-toggle
The item wrapper can participate in a group or work as a standalone pressed button when the group wrapper is not present. Inside a group, pass item identity with [tngButtonToggleValue] or [value] and let the group own the selected state.
Standalone item
html
<tng-button-toggle
[pressed]="isBold()"
(pressedChange)="isBold.set($event)"
>
Bold
</tng-button-toggle>