dropdown

fun <T> dropdown(options: List<String>, label: (String) -> String = { it }): @Composable (T, CellEditController) -> Unit(source)

A dropdown editor offering a fixed set of options.

The list opens under the cell, at least as wide as the cell, with the current value ticked and highlighted. Up, Down, Home, and End move the highlight, as does hovering. Typing jumps to the first option starting with what was typed, and typing quickly builds a longer prefix. Enter or a click commits, and Escape or a click outside cancels.

Parameters

options

The values a cell may take, which are also the text committed.

label

Turns an option into the text shown for it in the list and in the cell.