Ply checkbox is a labeled boolean control for forms. Install checkbox, bind ngModel, and use helper text or disabled like the other fields. For mixed parent/child trees use tri-state-checkbox; for an immediate on/off without a form label row, consider toggle.
Install with npx ply-ui-cli add checkbox.
Playground
<ply-checkbox color="primary" [checked]="true">Checkbox</ply-checkbox>
Default Checkbox example below.
<ply-checkbox color="primary" class="block mb-4"> Default checkbox </ply-checkbox> <ply-checkbox color="primary" class="block" checked="true"> Checkbox checked </ply-checkbox>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { CheckboxComponent } from './checkbox/checkbox.component';
@Component({
selector: 'app-checkbox-example',
imports: [
CheckboxComponent
],
template: `...`
})
export class CheckboxExampleComponent {}Install
npx ply-ui-cli add checkbox
Add [disabled]="true" to the <ply-checkbox> if need to disable the checkbox
<ply-checkbox color="primary" class="block mb-4" disabled="true"> Default checkbox </ply-checkbox> <ply-checkbox color="primary" class="block" checked="true" disabled="true"> Checkbox checked </ply-checkbox>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { CheckboxComponent } from './checkbox/checkbox.component';
@Component({
selector: 'app-checkbox-example',
imports: [
CheckboxComponent
],
template: `...`
})
export class CheckboxExampleComponent {}Install
npx ply-ui-cli add checkbox
Checkbox with helper text example below.
<ply-checkbox color="primary" class="block mb-4">
Default Checkbox
<p class="text-sm text-slate-600 font-light">
Some helper text here for example
</p>
</ply-checkbox>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { CheckboxComponent } from './checkbox/checkbox.component';
@Component({
selector: 'app-checkbox-example',
imports: [
CheckboxComponent
],
template: `...`
})
export class CheckboxExampleComponent {}Install
npx ply-ui-cli add checkbox
Use color="" attribute to define checkbox color. Supported colors are "primary", "success", "danger", "warning" and "accent"
<ply-checkbox color="primary"> Checkbox Primary </ply-checkbox> <ply-checkbox color="success"> Checkbox Success </ply-checkbox> <ply-checkbox color="accent"> Checkbox Accent </ply-checkbox> <ply-checkbox color="warning"> Checkbox Warning </ply-checkbox> <ply-checkbox color="danger"> Checkbox Danger </ply-checkbox>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { CheckboxComponent } from './checkbox/checkbox.component';
@Component({
selector: 'app-checkbox-example',
imports: [
CheckboxComponent
],
template: `...`
})
export class CheckboxExampleComponent {}Install
npx ply-ui-cli add checkbox
Run the following command to add this component to your project:
npx ply-ui-cli add checkbox
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.
npx -y ply-ui-mcp
Ply provides standalone components. Import the exact elements you want to use into your component.
// Install: npx ply-ui-cli add checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { CheckboxComponent } from './checkbox/checkbox.component';
@Component({
selector: 'app-your-component',
imports: [
CheckboxComponent
],
template: `...`
})
export class YourComponent {} API for checkbox — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
ply-checkbox | color | CheckboxColor | 'primary' | The semantic visual color. Defaults to 'primary'. |
ply-checkbox | disabled | boolean | false | Whether the control is disabled (consumer-facing input). |
ply-checkbox | checked | boolean | false | The checked state of the checkbox. Bound via ngModel. |
ply-checkbox | indeterminate | boolean | false | Marks the checkbox as visually/semantically indeterminate (mixed) state, e.g. for a "select all" checkbox when only some items are selected. Defaults to false. |
ply-checkbox | ariaLabel | string | undefined | undefined | Optional accessible name applied directly to the native `<input>`. Use this instead of `[attr.aria-label]` on `<ply-checkbox>` itself — the host element isn't the focusable/interactive part, so an attribute bound to the host would never reach assistive tech. |
Content