# Class RadioButton

A radio button widget with standard styling.

## Index

### Methods

- build
- getElement
- getLabel
- getRadio
- isSelected
- reset
- select

### Constructors

- constructor

## Methods

### build

- build(): HTMLElement

- - Defined in ui/FormWidgets/RadioButton.ts :61

  Gets the element on which the radio button is bound.

  #### Returns HTMLElement

  The radio button element.

### getElement

- getElement(): HTMLElement

- - Defined in ui/FormWidgets/RadioButton.ts :69

  Gets the element on which the radio button is bound.

  #### Returns HTMLElement

  The radio button element.

### getLabel

- getLabel(): HTMLLabelElement

- - Defined in ui/FormWidgets/RadioButton.ts :97

  Gets the radio button [`label`]{@link RadioButton.label} element.

  #### Returns HTMLLabelElement

  The `label` element.

### getRadio

- getRadio(): HTMLInputElement

- - Defined in ui/FormWidgets/RadioButton.ts :89

  Gets the `input` element (the radio button itself).

  #### Returns HTMLInputElement

  The `input` element.

### isSelected

- isSelected(): boolean

- - Defined in ui/FormWidgets/RadioButton.ts :81

  Indicates whether the radio button is selected.

  #### Returns boolean

  `true` if the radio button is selected, `false` otherwise.

### reset

- reset(): void

- - Defined in ui/FormWidgets/RadioButton.ts :37

  Resets the radio button.

  #### Returns void

### select

- select(triggerChange?: boolean): void

- - Defined in ui/FormWidgets/RadioButton.ts :49

  Select the radio button

  #### Parameters

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

    will trigger change event if specified and the radio button is not already selected

  #### Returns void

## Constructors

### constructor

- new RadioButton(onChange?: function, label: string, name: string, id?: string): RadioButton

- - Defined in ui/FormWidgets/RadioButton.ts :16

  Creates a new `RadioButton`.

  #### Parameters

  - ##### Default value onChange: function = (radioButton: RadioButton) => {}

    The function to call when the radio button value changes. This function takes the current `RadioButton` instance as an argument.

    - - (radioButton: RadioButton): void

      - #### Parameters

        - ##### radioButton: RadioButton

        #### Returns void

  - ##### label: string

    The label to display next to the radio button.

  - ##### name: string

    The value to set the `input` HTMLElement `name` attribute to.

  - ##### Default value id: string = label

  #### Returns RadioButton

### Hierarchy

- RadioButton

### Implements

- IFormWidgetWithLabel
- IFormWidgetSelectable