Dropdown button

Updated at:

Introduction

The dropdown button is a basic Mobi component that consists of a main button and a dropdown menu on the right. You can click the main button to perform the default action. You can click the icon to display more options. The icon is customizable.

Configuration items

Category

Configuration

Example

Description

Content

Menu list

The list of items in the dropdown menu. Add multiple action options to let users quickly select and run features.

Edit node

Select an item from the menu list and click Edit node to set its title, icon, disabled state, and event handler.

Configure event handler

Configure properties such as events, actions, component configurations, advanced execution conditions, and debounce.

Button text

The text that appears on the button.

Button type

Controls the style and behavior of the button. Options include the following: Primary, Default, Dashed, Text, and Link.

Enable badge

Specifies whether to show the badge.

Badge configuration

If the badge is enabled, you can configure its properties.

Tooltip

Specifies whether to show the tooltip.

Tooltip configuration

If the tooltip is enabled, you can configure its properties.

Extension configuration

Configure prefix and suffix icons for the button text.

Interaction

Hidden

Hides the component. For more information, see General properties.

Popup position

Sets the position where the menu list appears.

Trigger method

Sets whether the menu list appears on click or on hover.

Loading

Shows a loading animation.

Disabled

Controls whether the component is disabled. A disabled component is grayed out to indicate that it is unavailable.

Style

Height

The height of the component. For more information, see General properties.

Margin

The margin of the component. For more information, see General properties.

Ghost style

image

Specifies whether to use the ghost style.

Danger button

Displays a danger button mark to emphasize a high-risk operation. This is typically used for buttons that involve data loss, account deletion, or other irreversible actions.

Button shape

The shape of the button. You can set it to default, circle, or rounded.

Button layout

The layout of the button within its container. Options: Block, Left, Center, Right.

CSS style

CSS style

Add a CSS style.

Border radius

For more information, see General properties.

Button content font size

The font size of the button content.

Button content line height

The line height of the button content.

Primary button active background color

For more information, see General properties.

Primary button active text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Primary button hover background color

For more information, see General properties.

Primary button hover text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Primary button background color

For more information, see General properties.

Primary button text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Default button active background color

For more information, see General properties.

Default button active border color

For more information, see General properties.

Default button active text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Default button hover background color

For more information, see General properties.

Default button hover border color

For more information, see General properties.

Default button hover text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Default button background color

For more information, see General properties.

Default button border color

For more information, see General properties.

Default button text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Text button active background color

For more information, see General properties.

Text button disabled text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Text button text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Text button hover background color

For more information, see General properties.

Link button active text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Link button text color

Sets the text color. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Link button hover text color

For more information, see General properties.

Properties and methods

Name

Type

Example

Description

text

string

dropdownButton.text

The button text.

setText

func

dropdownButton.setText('Button')

Sets the button text.

clearText

func

dropdownButton.clearText()

Clears the button text.

loading

boolean

dropdownButton.loading

The loading state of the button.

setLoading

func

dropdownButton.setLoading(true)

Sets the loading state of the button.

disabled

boolean

dropdownButton.disabled

Specifies whether the button is disabled.

setDisabled

func

dropdownButton.setDisabled(true)

Sets whether the button is disabled.

clearDisabled

func

dropdownButton.clearDisabled()

The Purge button is disabled for the current status.

click

func

dropdownButton.click()

The click action.

Event callbacks

Event name

Description

The callback that is triggered when the component is clicked.