DialogInput

fun DialogInput(state: DialogState, value: MutableState<String>, label: String = "", inputPlaceholder: String = "", singleLine: Boolean = false, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, minLines: Int = 1, keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), enabled: Boolean = true, clearable: Boolean = true, prefix: String = "", suffix: String = "", textStyle: TextStyle = LocalTextStyle.current, validator: DialogInputValidator = rememberDialogInputValidator(), requestFocus: Boolean = false, selectionState: DialogInput.SelectionState = DialogInput.SelectionState.Default, onTextStateChanged: (valid: Boolean, text: String) -> Unit = { _, _ -> }, title: @Composable () -> Unit? = null, icon: @Composable () -> Unit? = null, style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(), buttons: DialogButtons = DialogDefaults.buttons(), options: DialogOptions = DialogDefaults.options(), onEvent: (event: DialogEvent) -> Unit = {})

Shows a dialog with an input field

 

Basic Parameters: all params not described here are derived from Dialog, check it out for more details

Parameters

value

the selected text

label

the optional label of the input field

inputPlaceholder

the placeholder the for the input field

singleLine

if true, the input field will only allow a single line

maxLines

the max lines for the input field

minLines

the min lines for the input field

keyboardOptions

the KeyboardOptions for the input field

enabled

if true, the input field is enabled

clearable

if true, the input field can be cleared by a trailing clear icon

prefix

the prefix for the input field

suffix

the prefix for the input field

textStyle

the TextStyle for the input field

validator
requestFocus

if true, the input field will request the focus when the dialog si shown (and open the keyboard)

selectionState

if initial selection state (DialogInput.SelectionState) of the input field

onTextStateChanged

an optional callback that will be called whenever the value of the input field changes