Try Install Learn Blog API Packages GitHub
Pages

Ui.Dropdown

A dropdown component, which renders the given content around the given element using the given position.

States

width
:
Number
=
0

The width of the panel if matchWidth is true.

Properties

closeOnOutsideClick
:
Bool
=
false

Wether or not to trigger the close event when clicking outside of the panel.

content
:
Html
=
<{ }>

The content to show in the dropdown.

element
:
Html
=
<{ }>

The element which trigger the dropdown.

matchWidth
:
Bool
=
false

Wether or not to make the dropdown the same width as the element.

offset
:
Number
=
0

The offset from the side of the element.

onClick
:
Function(Html.Event, Promise(Never, Void))
=
Promise.never1

The click event handler.

onClose
:
Function(Promise(Never, Void))
=
Promise.never

The close event handler.

open
:
Bool
=
false

Wether or not the dropdown is open.

position
:
String
=
"bottom-left"

The position of the panel.

zIndex
:
Number
=
1

The zIndex to use for the dropdown.

Functions

close
(
event
:
Html.Event
)
:
Promise(Never, Void)

The close event handler.

render
:
Html

Renders the dropdown.

updateDimensions
:
Promise(Never, Void)

Updates the dimensions of the panel if matchWidth is true.