Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · FORM CONTROLS

<dj-checkbox>

A form-associated checkbox composing <dj-label>. Submits value (default "on") when checked, nothing when not. Mirrors required-validity to the host.

Try it in the playground

@dojo-ng/checkbox · v0.1.2

npm install @dojo-ng/checkbox

import "@dojo-ng/checkbox";

Properties

PropertyAttributeTypeDefault
checked checked reflected boolean false
value value string "on"
name name reflected string None
disabled disabled reflected boolean false
readonly readonly reflected boolean false
required required reflected boolean false
labelHidden label-hidden boolean false

Events

change

Slots

Default slot

CSS parts

Style these with dj-checkbox::part(name).

PartDescription
controlthe box
label

Methods

checkValidity(): booleanreportValidity(): booleanfocus(options: FocusOptions)restoreFormState(state: File | string | FormData | null)