Free
Pro

Tri-State Checkbox

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.

freenew

Playground

color
state

HTML

<ply-tri-state-checkbox color="primary" state="indeterminate">Tri State Checkbox</ply-tri-state-checkbox>

Basic usage

Click the control to cycle states. Bind with [(ngModel)] or formControlName.

State: false (unchecked)


Colors

Same color tokens as ply-checkbox: primary, success, danger, warning, accent.

Initial indeterminate

Seed the control with 'indeterminate' when needed.

State: "indeterminate"

Disabled

Installation

Run the following command to add this component to your project:

bash

npx ply-ui-cli add tri-state-checkbox

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.

bash

npx -y ply-ui-mcp

Ply provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// 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 reference for tri-state-checkbox
APIMemberTypeDefaultDescription
ply-tri-state-checkboxclassstring''Extra host classes merged via `cn()`.
ply-tri-state-checkboxcolorCheckboxColor'primary'Semantic visual color.
ply-tri-state-checkboxdisabledbooleanfalseWhether the control is disabled (consumer-facing input).
ply-tri-state-checkboxstateTriCheckboxStatefalseCurrent tri-state value. Prefer `[(ngModel)]` / `formControlName` in forms. Also supports two-way binding via `[(state)]`.
ply-tri-state-checkboxariaLabelstring | undefinedundefinedOptional accessible name for the native input when there is no visible label text.