Skip to main content

Dropdown

Ant Design

The Dropdown component is a button that opens a menu of actions, such as Edit, Duplicate and Delete for a record.

Properties​

Property
Description
Expected Value
TextText shown on the button.Text. Default: Actions
Menu itemsThe menu entries, as a list of {key, label}. Add danger: true to show an entry in red, for actions that delete or remove data.Array
Typeprimary fills the button with the theme color; default has a border.default, primary. Default: default
Split buttonSplits the button in two: the main part runs its own action and an arrow part opens the menu.On or off. Default: Off
TriggerWhether the menu opens when the user clicks the button or hovers over it.click, hover. Default: click
PlacementWhere the menu opens relative to the button.bottomLeft, bottom, bottomRight, topLeft, top, topRight. Default: bottomLeft
ArrowShows a small arrow on the menu that points at the button.On or off. Default: Off
BlockMakes the button fill the width of its box.On or off. Default: Off

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On clickTriggers when the user picks a menu entry.
On button clickTriggers when the user clicks the main part of a split button.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set visibilityShows the component when true, hides it when false.components.dropdown1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.dropdown1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.dropdown1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
childrenText shown on the button.{{components.dropdown1.children}}
itemsThe menu entries, as a list of {key, label}. Add danger: true to show an entry in red, for actions that delete or remove data.{{components.dropdown1.items}}
typeprimary fills the button with the theme color; default has a border.{{components.dropdown1.type}}
splitSplits the button in two: the main part runs its own action and an arrow part opens the menu.{{components.dropdown1.split}}
triggerWhether the menu opens when the user clicks the button or hovers over it.{{components.dropdown1.trigger}}
placementWhere the menu opens relative to the button.{{components.dropdown1.placement}}
arrowShows a small arrow on the menu that points at the button.{{components.dropdown1.arrow}}
blockMakes the button fill the width of its box.{{components.dropdown1.block}}
selectedKeyKey of the menu entry the user picked last.{{components.dropdown1.selectedKey}}
isVisibleWhether the component is visible.{{components.dropdown1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.dropdown1.isLoading}}
isDisabledWhether the component is disabled.{{components.dropdown1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.