import {TriStateCheckboxModule} from 'primeng/primeng';
TriStateCheckbox is defined using p-triStateCheckbox element and requires a value binding via ngModel.
<p-triStateCheckbox [(ngModel)]="value"></p-triStateCheckbox>
export class ModelComponent {
value: any;
}
TriStateCheckbox can be used in a model driven form as well.
<p-triStateCheckbox formControlName="property"></p-triStateCheckbox>
Name | Type | Default | Description |
---|---|---|---|
name | string | null | Name of the component. |
disabled | boolean | false | When present, it specifies that the element should be disabled. |
Name | Parameters | Description |
---|---|---|
onChange | event.originalEvent: Original browser event event.value: Current value. |
Callback to invoke on value change. |
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
ui-chkbox | Container element |
ui-tristatechkbox | Container element |
ui-chkbox-box | Container of icon. |
ui-chkbox-icon | Icon element. |
None.
<h3 class="first">Value: {{value}}</h3>
<p-triStateCheckbox [(ngModel)]="value"></p-triStateCheckbox>
export class TriStateCheckboxDemo {
value: any;
}