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

Button

Extends:

flarum/Component~Component → Button

The Button component defines an element which, when clicked, performs an action. The button may have the following special props:

  • icon The name of the icon class. If specified, the button will be given a 'has-icon' class name.
  • disabled Whether or not the button is disabled. If truthy, the button will be given a 'disabled' class name, and any onclick handler will be removed.
  • loading Whether or not the button should be in a disabled loading state.

All other props will be assigned as attributes on the button element.

Note that a Button has no default class names. This is because a Button can be used to represent any generic clickable control, like a menu item.

Method Summary

Public Methods
public

view(): *

Protected Methods
protected

Get the template for the button's content.

Public Methods

public view(): * source

Return:

*

Protected Methods

protected getButtonContent(): * source

Get the template for the button's content.

Return:

*