Angular TriStateCheckbox is used to select either "true", "false" or "null" as the value.
Setup
Refer to PrimeNG setup documentation for download and installation steps for your environment.
Import
import {TriStateCheckboxModule} from 'primeng/tristatecheckbox';
Getting Started
TriStateCheckbox is defined using p-triStateCheckbox element and requires a value binding via ngModel.
<p-triStateCheckbox [(ngModel)]="value" label="Item Label"></p-triStateCheckbox>
export class ModelComponent {
value: any;
}
Model Driven Forms
TriStateCheckbox can be used in a model driven form as well.
<p-triStateCheckbox formControlName="property"></p-triStateCheckbox>
Theming
TriStateCheckbox supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.
Resources
Visit the PrimeNG TriStateCheckbox showcase for demos and documentation.