Checkbox is an extension to standard checkbox element with theming.
import { CheckboxModule } from 'primeng/checkbox';Binary checkbox is used as a controlled input with ngModel and binary properties.
The indeterminate state indicates that a checkbox is neither "on" or "off".
Multiple checkboxes can be grouped together.
Checkboxes can be generated using a list of values.
Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
Checkbox provides small and large sizes as alternatives to the base.
When disabled is present, the element cannot be edited and focused.
The invalid state is applied using the ā invalid property to indicate failed validation, which can be integrated with Angular Forms.
Checkbox can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
Checkbox component uses a hidden native checkbox element internally that is only visible to screen readers. Value to describe the component can either be provided via label tag combined with inputId prop or using ariaLabelledBy, ariaLabel props.
| Key | Function |
|---|---|
| tab | Moves focus to the checkbox. |
| space | Toggles the checked state. |