NEURALNG
FORMSBETA

Checkbox

Native binary and tri-state controls with separate type-safe models, complete Angular Forms support and consumer-owned visuals.

Native inputSignal Forms readyMixed state

GET STARTED

Import

Both standalone contracts ship from the granular Checkbox entry point.

app.ts TypeScript
import {
  NeuralCheckbox,
  NeuralTriStateCheckbox,
  type NeuralTriStateCheckboxValue,
} from '@neural-ng/core/checkbox';

@Component({
  imports: [NeuralCheckbox, NeuralTriStateCheckbox],
})

Binary model

checked is always boolean. Projected text activates the real native checkbox through its wrapping label.

Not accepted

Tri-state model

The dedicated control cycles false → true → null → false. Null is the single authoritative mixed state.

Value: null (mixed)

States

Disabled, readonly, invalid and pending remain distinct so forms and assistive technology receive the correct contract.

Angular Forms

One native contract works with Signal Forms, Reactive Forms and template-driven forms without a legacy value accessor wrapper.

SIGNAL FORMS

true

REACTIVE FORMS

false

NGMODEL

true

Semantic events

stateChange fires only for a user action and includes previous state plus the native event. Programmatic model writes remain silent.

No user action yet.

Field composition

Inside Neural Field, Checkbox inherits control id, descriptions, required, invalid, pending, disabled, readonly, fluid and unstyled state.

field.html HTML
<neural-field required invalid pending>
  <neural-checkbox>Marketing consent</neural-checkbox>
  <small neuralFieldHint>Choose your preference.</small>
  <small neuralFieldError>Consent is required.</small>
</neural-field>

Additive class ownership

Convenience classes and typed state slots merge with the theme layer; ordinary classes never erase the component appearance.

classes.html HTML
<neural-checkbox
  checkboxClass="max-w-md"
  inputClass="peer"
  labelClass="font-semibold"
  [classes]="{
    control: 'ring-offset-2',
    checkedControl: 'shadow-sm'
  }"
>
  Additive consumer classes
</neural-checkbox>

Unstyled and typed slots

The native input, projected label, state and structural hooks stay intact while all NeuralNg visual classes are removed.

checked: false

Contract boundaries

Binary

Owns boolean checked state.

Tri-state

Owns boolean or null value.

Application

Owns business validation and persistence.