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

Checkbox

Extends:

src/common/Component.js~Component → Checkbox

Direct Subclass:

Switch

The Checkbox component defines a checkbox input.

Attrs

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

Method Summary

Public Methods
public

view(vnode: *): *

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 Methods

public view(vnode: *): * source

Params:

NameTypeAttributeDescription
vnode *

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