A free checkbox that cycles unchecked → checked → indeterminate on each click. The form value is true, false, or 'indeterminate'.
For parent-driven “select all” mixed state, keep using <ply-checkbox [indeterminate]> instead.
Playground
<ply-tri-state-checkbox color="primary" state="indeterminate">Tri State Checkbox</ply-tri-state-checkbox>
Click the control to cycle states. Bind with [(ngModel)] or formControlName.
State: false (unchecked)
<ply-tri-state-checkbox [(ngModel)]="basic"> Include archived items </ply-tri-state-checkbox>
basic: TriCheckboxState = false; // TriCheckboxState = boolean | 'indeterminate'
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add tri-state-checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { TriStateCheckboxComponent } from './tri-state-checkbox/tri-state-checkbox.component';
@Component({
selector: 'app-tri-state-checkbox-example',
imports: [
TriStateCheckboxComponent
],
template: `...`
})
export class TriStateCheckboxExampleComponent {}Install
npx ply-ui-cli add tri-state-checkbox
Same color tokens as ply-checkbox: primary, success, danger, warning, accent.
<ply-tri-state-checkbox color="success" [(ngModel)]="value">Success</ply-tri-state-checkbox>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add tri-state-checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { TriStateCheckboxComponent } from './tri-state-checkbox/tri-state-checkbox.component';
@Component({
selector: 'app-tri-state-checkbox-example',
imports: [
TriStateCheckboxComponent
],
template: `...`
})
export class TriStateCheckboxExampleComponent {}Install
npx ply-ui-cli add tri-state-checkbox
Seed the control with 'indeterminate' when needed.
State: "indeterminate"
mixed: TriCheckboxState = 'indeterminate';
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add tri-state-checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { TriStateCheckboxComponent } from './tri-state-checkbox/tri-state-checkbox.component';
@Component({
selector: 'app-tri-state-checkbox-example',
imports: [
TriStateCheckboxComponent
],
template: `...`
})
export class TriStateCheckboxExampleComponent {}Install
npx ply-ui-cli add tri-state-checkbox
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add tri-state-checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { TriStateCheckboxComponent } from './tri-state-checkbox/tri-state-checkbox.component';
@Component({
selector: 'app-tri-state-checkbox-example',
imports: [
TriStateCheckboxComponent
],
template: `...`
})
export class TriStateCheckboxExampleComponent {}Install
npx ply-ui-cli add tri-state-checkbox
Run the following command to add this component to your project:
npx ply-ui-cli add tri-state-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 tri-state-checkbox
// Paths are relative to aliases.components (default: src/app/components)
import { TriStateCheckboxComponent } from './tri-state-checkbox/tri-state-checkbox.component';
@Component({
selector: 'app-your-component',
imports: [
TriStateCheckboxComponent
],
template: `...`
})
export class YourComponent {} API for tri-state-checkbox — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
ply-tri-state-checkbox | class | string | '' | Extra host classes merged via `cn()`. |
ply-tri-state-checkbox | color | CheckboxColor | 'primary' | Semantic visual color. |
ply-tri-state-checkbox | disabled | boolean | false | Whether the control is disabled (consumer-facing input). |
ply-tri-state-checkbox | state | TriCheckboxState | false | Current tri-state value. Prefer `[(ngModel)]` / `formControlName` in forms. Also supports two-way binding via `[(state)]`. |
ply-tri-state-checkbox | ariaLabel | string | undefined | undefined | Optional accessible name for the native input when there is no visible label text. |
Content