Button Toggle
Component import
ts
import { TngButtonToggleComponent, TngButtonToggleGroupComponent } from '@tailng-ui/components';
Usage patterns
Use the group wrapper for single-select segmented controls and multi-select toolbars. The wrapper surfaces valueChange for single mode and valuesChange for multiple mode.
Single-select group
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 [tngButtonToggleValue]="'spacious'">Spacious</tng-button-toggle>
</tng-button-toggle-group>
Multi-select group
html
<tng-button-toggle-group
ariaLabel="Feature filters"
type="multiple"
[values]="filters()"
(valuesChange)="onFiltersChange($event)"
>
<tng-button-toggle [tngButtonToggleValue]="'a11y'">Accessibility</tng-button-toggle>
<tng-button-toggle [tngButtonToggleValue]="'signals'">Signals</tng-button-toggle>
<tng-button-toggle [tngButtonToggleValue]="'analytics'">Analytics</tng-button-toggle>
</tng-button-toggle-group>
Style variants
The same component contract can sit inside a plain CSS shell or a Tailwind shell without changing the API.
Density controls (Plain-CSS)
Feature filters (Tailwind CSS)
Feature flags
Keep the same component API while switching to a utility-driven shell.
Selected: a11y, signals