Checkbox

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.

Screen Reader

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.

Keyboard Support

KeyFunction
tabMoves focus to the checkbox.
spaceToggles the checked state.
Figma UI Kit
The official Figma UI Kit for Prime UI libraries, the essential resource for designing with PrimeOne components.