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

Switch

Extends:

src/common/Component.js~ComponentCheckbox → Switch

The Switch component is a Checkbox, but with a switch display instead of a tick/cross one.

Static Method Summary

Static Public Methods
public static

initAttrs(attrs: *)

Method Summary

Public Methods
public

getDisplay(): *

Inherited Summary

From class Checkbox
public

view(vnode: *): *

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.

Static Public Methods

public static initAttrs(attrs: *) source

Params:

NameTypeAttributeDescription
attrs *

Public Methods

public getDisplay(): * source

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

Override:

Checkbox#getDisplay

Return:

*