Skip to main content
The Checkbox component allows users to select one or more options from a set of choices with support for indeterminate state and custom labels.

Basic usage

<flx-checkbox
  label="Accept terms and conditions"
  [(ngModel)]="accepted">
</flx-checkbox>

Properties

label
string
Label text displayed next to the checkbox
checked
boolean
default:"false"
Whether the checkbox is checked
indeterminate
boolean
default:"false"
Whether the checkbox is in indeterminate state (partially checked)
disabled
boolean
default:"false"
Disables the checkbox
required
boolean
default:"false"
Marks the checkbox as required
value
any
Value associated with the checkbox (useful in groups)
error
boolean
default:"false"
Shows error state

Events

checkedChange
EventEmitter<boolean>
Emitted when the checked state changes

Examples

<flx-checkbox
  label="Subscribe to newsletter"
  [(ngModel)]="subscribed">
</flx-checkbox>

<flx-checkbox
  label="Remember me"
  [(ngModel)]="rememberMe">
</flx-checkbox>

Styling

flx-checkbox {
  --flx-checkbox-size: 18px;
  --flx-checkbox-border-radius: 3px;
  --flx-checkbox-border-color: #d1d5db;
  --flx-checkbox-checked-background: #3b82f6;
  --flx-checkbox-checked-border-color: #3b82f6;
  --flx-checkbox-checkmark-color: #ffffff;
  --flx-checkbox-disabled-opacity: 0.5;
  --flx-checkbox-error-border-color: #ef4444;
}

Accessibility

The Checkbox component provides full keyboard and screen reader support:
  • Space key toggles the checkbox
  • aria-checked reflects the current state
  • aria-required for required checkboxes
  • Proper label association
  • Radio - Single selection from options
  • Switch - Toggle switch for binary choices

Build docs developers (and LLMs) love