Reference Source
import Dropdown from 'flarum/compone/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'.
  • onhide
  • onshow

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

Member Summary

Public Members
public

Method Summary

Public Methods
public

getMenu(menuClassName: *, items: *): *

public

initAttrs(attrs: *)

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

view(vnode: *): *

Protected Methods
protected

getButton(attrs: *, children: *): *

Get the template for the button.

protected

getButtonContent(attrs: *, children: *): *

Get the template for the button's content.

Public Members

public showing: boolean source

Public Methods

public getMenu(menuClassName: *, items: *): * source

Params:

NameTypeAttributeDescription
menuClassName *
items *

Return:

*

public initAttrs(attrs: *) source

Params:

NameTypeAttributeDescription
attrs *

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(attrs: *, children: *): * source

Get the template for the button.

Params:

NameTypeAttributeDescription
attrs *
children *

Return:

*

protected getButtonContent(attrs: *, children: *): * source

Get the template for the button's content.

Params:

NameTypeAttributeDescription
attrs *
children *

Return:

*