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

Dropdown

Extends:

src/common/Component.js~Component → Dropdown

Indirect Subclass:

SettingDropdown

The Dropdown component displays a button which, when clicked, shows a dropdown menu beneath it.

Attrs

  • buttonClassName A class name to apply to the dropdown toggle button.
  • menuClassName A class name to apply to the dropdown menu.
  • icon The name of an icon to show in the dropdown toggle button.
  • caretIcon The name of an icon to show on the right of the button.
  • label The label of the dropdown toggle button. Defaults to 'Controls'.
  • accessibleToggleLabel The label used to describe the dropdown toggle button to assistive readers. Defaults to 'Toggle dropdown menu'.
  • onhide
  • onshow

The children will be displayed as a list inside of the dropdown menu.

Static Method Summary

Static Public Methods
public static

initAttrs(attrs: *)

Member Summary

Public Members
public

Method Summary

Public Methods
public

getMenu(items: *): *

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

view(vnode: *): *

Protected Methods
protected

getButton(children: *): *

Get the template for the button.

protected

getButtonContent(children: *): *

Get the template for the button's content.

Static Public Methods

public static initAttrs(attrs: *) source

Params:

NameTypeAttributeDescription
attrs *

Public Members

public showing: boolean source

Public Methods

public getMenu(items: *): * source

Params:

NameTypeAttributeDescription
items *

Return:

*

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public oninit(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public view(vnode: *): * source

Params:

NameTypeAttributeDescription
vnode *

Return:

*

Protected Methods

protected getButton(children: *): * source

Get the template for the button.

Params:

NameTypeAttributeDescription
children *

Return:

*

protected getButtonContent(children: *): * source

Get the template for the button's content.

Params:

NameTypeAttributeDescription
children *

Return:

*