Reference Source
import Checkbox from 'flarum/components/Checkbox.js'
public class | source

Checkbox

Extends:

flarum/Component~Component → Checkbox

The Checkbox component defines a checkbox input.

Props

  • state Whether or not the checkbox is checked.
  • className The class name for the root element.
  • disabled Whether or not the checkbox is disabled.
  • onchange A callback to run when the checkbox is checked/unchecked.
  • children A text label to display next to the checkbox.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Whether or not the checkbox's value is in the process of being saved.

Method Summary

Public Methods
public

view(): *

Protected Methods
protected

getDisplay(): *

Get the template for the checkbox's display (tick/cross icon).

protected

onchange(checked: Boolean)

Run a callback when the state of the checkbox is changed.

Public Constructors

public constructor() source

Public Members

public loading: Boolean source

Whether or not the checkbox's value is in the process of being saved.

Public Methods

public view(): * source

Return:

*

Protected Methods

protected getDisplay(): * source

Get the template for the checkbox's display (tick/cross icon).

Return:

*

protected onchange(checked: Boolean) source

Run a callback when the state of the checkbox is changed.

Params:

NameTypeAttributeDescription
checked Boolean