Try Install Learn Blog API Packages GitHub
Pages

Ui.Select

A select component.

States

focused
:
Bool
=
false

A variable for tracking the focused state.

open
:
Bool
=
false

A variable for tracking the open state.

Properties

disabled
:
Bool
=
false

Wether or not the select is disabled.

invalid
:
Bool
=
false

Wether or not the select is invalid.

items
:
Array(Ui.ListItem)
=
[]

The items to show.

matchWidth
:
Bool
=
false

Wether or not the dropdown should match the width of the input.

offset
:
Number
=
5

The offset of the dropdown from the input.

onChange
:
Function(String, Promise(Never, Void))
=
Promise.never1

The change event handler.

placeholder
:
String
=
""

The placeholder to show when there is no value selected.

position
:
String
=
"bottom-right"

The position of the dropdown.

size
:
Number
=
16

The size of the select.

value
:
String
=
""

The key of the current selected element.

zIndex
:
Number
=
1

the z-index of the dropdown.

Functions

handleClickSelect
(
value
:
String
)
:
Promise(Never, Void)

Handles the click event.

handleClicks
:
Promise(Never, Void)

Handles the up events.

handleClose
:
Promise(Never, Void)

Handler for the close event.

handleFocus
:
Promise(Never, Void)

Handler for the focus event.

handleKeyDown
(
event
:
Html.Event
)

Handles the keydown event.

handleTabIn
:
Promise(Never, Void)

Handler for the tab in event.

render
:
Html

Renders the select.