# Class Checkbox

A checkbox widget with standard styling.

## Index

### Methods

- build
- getElement
- getLabel
- getValue
- isSelected
- reset
- select
- toggle

### Constructors

- constructor

## Methods

### build

- build(): HTMLElement

- - Defined in ui/FormWidgets/Checkbox.ts :56

  Gets the element on which the checkbox is bound.

  #### Returns HTMLElement

  The checkbox element.

### getElement

- getElement(): HTMLElement

- - Defined in ui/FormWidgets/Checkbox.ts :48

  Gets the element on which the checkbox is bound.

  #### Returns HTMLElement

  The checkbox element.

### getLabel

- getLabel(): HTMLElement

- - Defined in ui/FormWidgets/Checkbox.ts :104

  Gets the element on which the checkbox [`label`]{@link Checkbox.label} is bound.

  #### Returns HTMLElement

  The `label` element.

### getValue

- getValue(): string

- - Defined in ui/FormWidgets/Checkbox.ts :64

  Gets the checkbox [`label`]{@link Checkbox.label} value.

  #### Returns string

  The checkbox label value.

### isSelected

- isSelected(): boolean

- - Defined in ui/FormWidgets/Checkbox.ts :96

  Indicates whether the checkbox is checked.

  #### Returns boolean

  `true` if the checkbox is checked, `false` otherwise.

### reset

- reset(): void

- - Defined in ui/FormWidgets/Checkbox.ts :71

  Resets the checkbox.

  #### Returns void

### select

- select(triggerChange?: boolean): void

- - Defined in ui/FormWidgets/Checkbox.ts :83

  Select the checkbox

  #### Parameters

  - ##### Default value triggerChange: boolean = true

    will trigger change even if specified and not already selected

  #### Returns void

### toggle

- toggle(): void

- - Defined in ui/FormWidgets/Checkbox.ts :39

  Toggles the checkbox state.

  #### Returns void

## Constructors

### constructor

- new Checkbox(onChange?: function, label: string, ariaLabel?: string, labelSuffix?: string): Checkbox

- - Defined in ui/FormWidgets/Checkbox.ts :19

  Creates a new `Checkbox`.

  #### Parameters

  - ##### Default value onChange: function = (checkbox: Checkbox) => {}

    The function to call when the checkbox state changes. This function takes the current `Checkbox` instance as an argument.

    - - (checkbox: Checkbox): void

      - #### Parameters

        - ##### checkbox: Checkbox

        #### Returns void

  - ##### label: string

    The label to display next to the checkbox.

  - ##### Optional ariaLabel: string

  - ##### Optional labelSuffix: string

  #### Returns Checkbox

### Hierarchy

- Checkbox

### Implements

- IFormWidgetWithLabel
- IFormWidgetSelectable